2 ms·
> Promises are a monad, Actually, they're not. Get ready: https://github.com/promises-aplus/promises-spec/issues/94 https://github.com/promises-aplus/promises-
by steveklabnik 13y ago
> Promises are a monad,
Actually, they're not. Get ready: https://github.com/promises-aplus/promises-spec/issues/94 https://github.com/promises-aplus/promises-spec/issues/94
- jdonaldson 13y agoPromise A+ is scary bad. They're trying to shoehorn all of the functionality of a monad based implementation into a single method: http://promises-aplus.github.io/promises-spec/#the__method http://promises-aplus.github.io/promises-spec/#the__method Of course, this relies on a lot of dynamic inspection and runtime checks. Of course, this means that you can't compose with A+ promise methods in a reliable way. Of course, this means that their implementation is not going to be compatible with anyone else's. Of course, this means that everyone else's version of promises is "broken". If you're interested in approaches that follow algebraic/monad patterns, check out fantasyland spec: https://github.com/fantasyland/fantasy-land https://github.com/fantasyland/fantasy-land The name of the spec is a joke, but the spec itself is not. It's referencing a very real sentiment: That developers that want to use formal composition techniques in their js are living in a "fantasy land".