3 ms·
> The only point of a Monad is that in a lazy language it desugars into an implicit nested functions, which guarantees the order of evaluation. That is not tru
by choeger 8y ago
> The only point of a Monad is that in a lazy language it desugars into an implicit nested functions, which guarantees the order of evaluation.
That is not true at all. You seem to confuse side-effect-free with lazy and the state monad with any monad. Monad instances like options or either data types allow for the simple composition of functions that yield them. In any language. Promises form a useful monad because there is no other way to talk about values that have not been evaluated yet.
- throwaway487549 8y ago> there is no other way to talk about values that have not been evaluated yet. There is a way, and it is known since at least R5RS. https://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Promises.html https://www.gnu.org/software/mit-scheme/documentation/mit-sc...