News for hackers. Stuff that matters.
Re:Monads Are Not Metaphors (2010) by tikhonj on Thursday September 10, 2015 @12:11PM (#10198876)
I've used Async and LWT in OCaml—libraries for monadic asynchronous programming—and the abstraction can still be useful without syntax sugar.

Hell, JavaScript promises are basically a bastardized and slightly inconsistent monad, and they're still useful even without syntax sugar. If we could generalize over the API and use them for other things it would be even better, but that's not the JavaScript way.

Re:Monads Are Not Metaphors (2010) by olavk on Thursday September 10, 2015 @04:57PM (#10200519)
How are JS promises monads?
Re:Monads Are Not Metaphors (2010) by tikhonj on Thursday September 10, 2015 @06:08PM (#10200868)
They actually operate on more or less the same principle as Async and LWT, similar to Haskell's Cont.

The .then method is bind. Or it would be if they didn't automatically flatten nested promises. Since they do, then is a hybrid of map and bind that doesn't quite cover the use cases for both.