monadic extension to do-notation
Isiah Meadows
isiahmeadows at gmail.com
Wed Feb 10 06:49:40 UTC 2016
I see little to be gained, and it's not clear that it's in a different
context. Plus, assuming your editor balances parentheses and auto indents,
I see no more than about 8-10 keystrokes saved for something that isn't
super frequently used. Not saying it's a bad idea, but ES has gotten to the
point most of the truly lacking features aren't in the language anymore,
especially with ES7 and the first things on the train for ES8 (async
functions barely missed it by a couple weeks, because of implementors).
On Wed, Feb 10, 2016, 01:40 /#!/JoePea <joe at trusktr.io> wrote:
> On Tue, Feb 9, 2016 at 10:28 PM, Isiah Meadows <isiahmeadows at gmail.com>
> wrote:
> > let finalPromise = (async () => {
> > let x = await promiseA
> > let y = await promiseB
> > let c = f(a, b)
> > return g(a, b, c)
> > })()
>
> I think it's important to keep the async/await keywords because they
> give a more readable semantic description of what's happening. What
> about `async do`?
>
> ```javascript
> let finalPromise = async do {
> let a = await promiseA
> let b = await promiseB
> let c = f(a, b)
> g(a, b, c)
> }
> ```
>
> That reads better!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160210/d5aae8dd/attachment-0001.html>
More information about the es-discuss
mailing list