I found it [a fun exercise](https://gist.github.com/domenic/5632079) to show 
how little code it takes to build unabashed monadic promises on top of Q-like 
promises. (It's been a while since I exercised those brain-muscles, so any 
corrections appreciated.) The punch line is
 
```js
function unit(x) {
    return Q({ x });
}

function bind(m, f) {
    return m.then({ x } => f(x));
}
```

My interpretation of this exercise---apart from the fact that I miss doing 
mathematical proofs---is that, since it's so little code to implement unabashed 
monadic promises on top of Q-like promises, and Q-like promises have proven 
their worth in JavaScript whereas unabashed monadic promises have not, it makes 
much more sense to standardize on Q-like promises as the base, and leave 
unabashed monadic promises to user-space libraries.

(Abashed monadic promises are, of course, a failure mode of 
standardization---as Mark points out---and not really worth considering.)
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to