Deprecating Future's .then()

Rick Waldron waldron.rick at
Wed Jun 5 07:59:36 PDT 2013

On Wed, Jun 5, 2013 at 5:29 AM, Tom Van Cutsem < at> wrote:

> 2013/6/4 Tab Atkins Jr. <jackalmage at>
> On Wed, Jun 5, 2013 at 12:51 AM, Mark S. Miller <erights at>
>> wrote:
>> > I am making here only an argument that .then's result behavior should be
>> > flatMap-like rather than .map-like. As for which of these the .chain
>> camp
>> > prefers for .chain's result behavior, I am neutral. But if they choose
>> > .map-like, they'd be able to avoid the ugly assimilation hack.
>> Given that .chain is just a proposed name for the monadic operation,
>> which could also be called .flatMap, obviously the return value's
>> behavior should be flatMap like.
> Here's another argument I haven't heard before:
> .flatMap seems like an excellent name because it immediately provides a
> clue as to what it does without having to look up any docs at all. Given
> that as a JS dev you know, you'll have some intuition that
> .flatMap() does what map() does, with flattening (it's a pity we don't have
> array.flatten() ).
> Similarly, Promise.of(val) is way clearer than Promise.accept/fulfill, if
> you compare it to Array.of(val) (not sure we eventually agreed to add such
> a method,

To clarify for Tom and anyone else following that was unsure:
Array.of(...items) has been spec'ed and is located at of rev15


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list