3 ms·
> Promises are functors not monads That's not quite true. `then` is a weird hybrid of `map` and `bind`. If its callback returns a Promise it acts like `bind` (
by matt_kantor 8y ago
> Promises are functors not monads
That's not quite true. `then` is a weird hybrid of `map` and `bind`. If its callback returns a Promise it acts like `bind` (you don't get a nested Promise), but otherwise it acts like `map`.
And to be pedantic, Promise is neither a functor nor monad because `then` doesn't follow the necessary laws.