4 ms·
The point where a JS developer is most likely to run into monads is with asynchronous code. We call it "callback hell," and the reason it exists is because asyn
by GeneralMayhem 13y ago
The point where a JS developer is most likely to run into monads is with asynchronous code. We call it "callback hell," and the reason it exists is because async callbacks, like monads, can't be easily "escaped" - everything done with a result must be used in the same monadic (asynchronous) context. Once you enter a callback-based function, you usually can't simply return from it and go back to standard sequentially-executed code.
It takes a bit more work to formally show that continuations follow the monad laws, but that's as much as it took for me to begin to get the concept.