4 ms·
How are JS promises monads?
by olavk 11y ago
How are JS promises monads?
- tikhonj 11y agoThey 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.