Comment on What programming languages aren't too criticized here?

<- View Parent
alr@programming.dev ⁨1⁩ ⁨year⁩ ago

If you use JavaScript, you’ve probably seen a monad, since Promise is a monad. Unit is Promise.resolve(), bind is Promise.then(). As required, Promise.resolve(x).then(y) === y(x) (unit forms a left identity of bind), y.then(Promise.resolve) === y (unit forms a right identity of bind), and x.then(y.then(z)) === x.then(y).then(z) (bind is essentially associative).

source
Sort:hotnewtop