monadic extension to do-notation
Alan Johnson
alan at breakrs.com
Mon Feb 22 16:28:35 UTC 2016
If this is done, please go with `async do { … await … }`. May as well reuse existing syntax as much as possible. As mentioned, `<-` is problematic both from the standpoint of conflict with existing operators and incomplete analogy with Haskell. If the result should be Promise-ified, best to indicate this explicitly with `async`.
I do think that having a syntax for async expressions is very useful. IIFEs already feels like a hack around the lack of expression-orientedness of control flow structures in JS, and async-IIFEs just compound the issue of syntactic noise for straightforward operations.
More information about the es-discuss
mailing list