4 ms·
Have to admit that has also been my reaction to some of these javascript async frameworks based on promises or deferreds. Congratulations, you've reimplemented
by mjw 14y ago
Have to admit that has also been my reaction to some of these javascript async frameworks based on promises or deferreds. Congratulations, you've reimplemented a quirky ad-hoc variant on the continuation and error monads.
Perhaps people don't spot the link as easily because monads are usually explained in terms of a type system, and javascript is untyped? (Or perhaps just because Monad is a very abstract abstraction :)
- tel 14y agoThere's the async component as well, but I think `ErrorT e Par a` covers it.
- chousuke 14y agoRegarding your latter point, I don't think monads are even that abstract. "Monad" just happens to be something out of category theory so it has a mathematical weird-sounding name that you MIGHT guess has something to do with monoids -- if you know what monoids are -- so people think it has to be something complicated when in practice it's just a nice unified interface for glue code.