Juan Ignacio Dopazo (2014-01-28T18:20:00.000Z)
On Tuesday, January 28, 2014 10:13 AM, Kevin Smith <zenparsing at gmail.com> wrote:


>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
>Promise.resolve(otherPromise).
>

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 words, nestable).

That's not true as per the last consensus. There was `Promise.fulfill(p)` which would've nested promises, but it was left for ES7 to investigate fulfill+flatMap.

Juan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140128/dc6dbe50/attachment.html>
domenic at domenicdenicola.com (2014-02-04T16:07:41.412Z)
That's not true as per the last consensus. There was `Promise.fulfill(p)` which would've nested promises, but it was left for ES7 to investigate fulfill+flatMap.
domenic at domenicdenicola.com (2014-02-04T16:07:16.713Z)
On Tuesday, January 28, 2014 10:13 AM, Kevin Smith <zenparsing at gmail.com> wrote:


>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
>Promise.resolve(otherPromise).
>

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 words, nestable).

That's not true as per the last consensus. There was `Promise.fulfill(p)` which would've nested promises, but it was left for ES7 to investigate fulfill+flatMap.