Message from JavaScript discussions

August 2018

— Didn't get this

— 

Promise.resolve(2)
.then(() => Promise.resolve(4))


Becomes:
Promise { 4 }

But should become:
Promise { Promise { 4 } }

— So the last resolve looses its context

— Monad -> plain value

— Illegal!

— Unit = Promise.resolve
bind = then

— For promises, yes

— For monads, no

— Oh?

— Wrong

— Promise.resolve does return a promise

— Just that the chain looses its context because Promises flatten