Promise.cast and Promise.resolve

Quildreen Motta quildreen at gmail.com
Tue Jan 28 15:58:31 PST 2014


On 28 January 2014 21:27, Andreas Rossberg <rossberg at google.com> wrote:

> On 28 January 2014 21:21, Quildreen Motta <quildreen at gmail.com> wrote:
>

> > But later, once `flatMap` is introduced, you'll be able to deal with
> nested
> > promises without breaking parametricity:
> >
> > Promise.flatMap :: (Promise(a)) => (a → Promise(b))
> >
> > If that's correct, I don't see any use cases for Promise.resolve right
> now,
> > unless a library where to provide a corresponding unspecified `flatMap`
> > implementation.
>
> The V8 implementation provides it under the name `chain', with the
> obvious semantics.


Considering that the fantasy-land specification uses the `chain` name as
well, this is really neat.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140128/380183a8/attachment-0001.html>


More information about the es-discuss mailing list