A Challenge Problem for Promise Designers (was: Re: Futures)
Tab Atkins Jr.
jackalmage at gmail.com
Thu Apr 25 18:39:26 PDT 2013
On Thu, Apr 25, 2013 at 6:03 PM, Dean Tribble <tribble at e-dean.com> wrote:
> So what's an example
> that motivates you to want to build a tower of promise types? The main one
> I know of is the implementation (not use of) higher-order collection
> constructs that use promises internally (e.g., the implementation of map and
> reduce for an async, batching, flow-controlled stream of Promise<T>). That
> kind of rare example can have more advanced hooks (like Q).
I think it's more important to see examples of why you want to
*flatten* them automatically. Having "towers of promises" keeps us
consistent with Futures-as-monads, which is useful from a theoreticaly
standpoint. This is similar, from an algebraic standpoint, to
allowing arrays of arrays, or sets of sets, or any other monadic
context doubled up.
More information about the es-discuss