4 ms·
Yes, Promises are similar to monads but they don't obey all the monadic laws; as a result they don't compose as well. This means that you're always "stuck in t
by bcheung 7y ago
Yes, Promises are similar to monads but they don't obey all the monadic laws; as a result they don't compose as well.
This means that you're always "stuck in the weeds" of promises and can't write code that abstracts it away. Or that treats promises, observables, arrays, etc, exactly the same since they all have different "interfaces".
In that sense JS is more complicated because other languages don't make you learn different syntax and APIs for each one.