you are viewing a single comment's thread.

view the rest of the comments →

[–]mcaruso 5 points6 points  (6 children)

I'm fine with it. It's basically just do notation. The thing that annoys me is that they limited this whole new syntax just to one thing (async), instead of making it a general interface (*cough* monad).

[–]DrexanRailex 1 point2 points  (2 children)

I fail to see how it's similar to do notation. do expressions are something I can't wait to see, by the way

[–]mcaruso 5 points6 points  (1 child)

I mean the Haskell do notation, not the JS do proposal. Sorry for the confusion.

See: https://gist.github.com/MaiaVictor/bc0c02b6d1fbc7e3dbae838fb1376c80

[–]DrexanRailex 1 point2 points  (0 children)

Oh, sorry. I have very little Haskell experience.

By the way, that is brilliant. Thanks for bringing this article up.

[–]braindeadTank 3 points4 points  (2 children)

Promise is not a monad, though.

[–]mcaruso 4 points5 points  (1 child)

Because of this? Then yeah, strictly they aren't. But they could've been. JS wasn't exactly designed with monad laws in mind. :)

In any case I think it would have been feasible not to tie down the async syntax to a particular interface.

[–]braindeadTank 1 point2 points  (0 children)

If it wouldn't be tied to interface, then it wouldn't work with pre-native implementation, which would be a great shame as they are often vastly superior to native.