Promise.cast and Promise.resolve
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
> > 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
> > 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...
More information about the es-discuss