The Paradox of Partial Parametricity

Russell Leggett russell.leggett at gmail.com
Tue May 28 11:04:08 PDT 2013


>
> I'm not arguing 'chain' be removed. I'm convinced at this point its worth
>> including, I'm just debating the method name here. Sorry if it's just
>> bikeshedding at this point, but on the face of it, the two methods seem
>> hard to distinguish, and while 'chain' might be a better name for some
>> hypothetical monadic style, why not leave it up to some library to give the
>> method a facelift. The same way that the promise API is being kept light,
>> and will likely still be wrapped by things like the Q library for
>> additional functionality, I expect some monadic focused library will be
>> used if using promises in the monadic style. Worst case scenario, you just
>> add an alias on the Promise prototype.
>>
>
>
> I agree with Russell that `chain` is a little ambiguous when juxtaposed
> with `then. Around the time this conversation first kicked up I'd proposed
> this API and referred to what Tab calls `chain` as the "one-step resolver
> function". I still think `resolve` would be a pretty good, reasonably
> self-documenting name -- especially compared to `chain`. You can describe
> `then` as a recursive `resolve` and the difference should be obvious.
>

Yes, I had suggested the name "resolveOnce" as I think it really helps
describe what it does in relation to 'then'. As someone learning for the
first time, I would likely read that and think, "Only once. That means
something else resolves more than once." Reading the docs for 'then' and
seeing the examples, would make it pretty clear to me that 'then' *just
works* while resolveOnce is more of a low level method.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130528/81d157b2/attachment.html>


More information about the es-discuss mailing list