Juan Ignacio Dopazo (2013-08-01T17:52:13.000Z)
2013/8/1 Mark S. Miller <erights at google.com>

> On the input side of .then and .flatMap, no.
> On the output side of both .then and .flatMap, depending on what you mean
> by "branding", yes. If .flatMap's callback returns a non-promise the
> promise it already returned gets rejected. If .then's callback returns a
> non-promise, the promise it already returned accepts that non-promise.
>
> That's why I included assimilation in the mix. If then() deep flattens
promises there's no difference with assimilation of thenables. Only
flatMap() could need to know if something is a "true promise" or not, and
even then it could still be more useful for flatMap() to duck type
(composition with other flatMappable objects).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130801/5aa2d4ee/attachment.html>
domenic at domenicdenicola.com (2013-08-05T20:03:55.253Z)
2013/8/1 Mark S. Miller <erights at google.com>

> On the input side of .then and .flatMap, no.
> On the output side of both .then and .flatMap, depending on what you mean
> by "branding", yes. If .flatMap's callback returns a non-promise the
> promise it already returned gets rejected. If .then's callback returns a
> non-promise, the promise it already returned accepts that non-promise.

That's why I included assimilation in the mix. If then() deep flattens promises there's no difference with assimilation of thenables. Only flatMap() could need to know if something is a "true promise" or not, and even then it could still be more useful for flatMap() to duck type (composition with other flatMappable objects).