2 ms·
Regarding monads, there's some discussion on whether promises really are monadic in JS here: https://gist.github.com/briancavalier/3296186 https://gist.github.c
by pluma 10y ago
Regarding monads, there's some discussion on whether promises really are monadic in JS here: https://gist.github.com/briancavalier/3296186 https://gist.github.com/briancavalier/3296186
Basically the counter-argument is that promises are not composable, i.e. you can't wrap a promise in another promise.
There was an attempt to convince the spec authors to make promises "true" monads but it failed for reasons of simple practicality: https://github.com/promises-aplus/promises-spec/issues/94 https://github.com/promises-aplus/promises-spec/issues/94