Hacker News new | ask | show | jobs
by acjohnson55 1469 days ago
Correct that there's no literal effect, but conceptually, if you wanted to model a particular sort of nondeterminism as a monad, you could use one indistinguishable from List.

And I think it holds just fine to think of the monad as injecting data into a sequential computation before each step and ingesting output after each step (boxed in the monadic container).

Which reminds me, that boxing is also part of the power of monads. It means you can nest steps of a monadic computation, instead of just chaining them, as a functor allows. This stimulates lexical scope -- bindings that exist for all statements after the one that defines them.