Promise.cast and Promise.resolve
zenparsing at gmail.com
Tue Jan 28 10:12:18 PST 2014
> My take is that the difference between "cast" and "resolve" is so
> subtle that I don't think it captures developer intention. In
> other words, if I see some code calling Promise.cast(otherPromise),
> I can't be sure that the developer made an intentional choice over
Note that `Promise.resolve(p)`, where p is a promise, does *not* return an
eventual for the eventual value of p. Rather, it returns an eventual for
p, literally. Promises should be considered fully parametric (in other
If you want to convert a maybe-promise into a promise, then you want `cast`.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss