Talk:Monads/Maybe monad: Difference between revisions

Content added Content deleted
Line 49: Line 49:
(The writer (or supplied write-and-wrap function) drafts a response, and places it in a new envelope, continuing the chain of correspondence)
(The writer (or supplied write-and-wrap function) drafts a response, and places it in a new envelope, continuing the chain of correspondence)


The data-type or context (the envelope) is not the monad. The monad is the envelope-type-specific pair of functions which abstract away the boiler-plate required wrapping and unwrapping, to facilitate a chain of envelope-wrapped computations.
The data-type or context (the envelope) is not the monad. The monad is the envelope-type-specific pair of functions which abstract away the boiler-plate required for wrapping and unwrapping, (extraction from a context, and embedding in that context), to facilitate a chain of computations that are embedded in some enclosing context.

===Foundational references===

[https://core.ac.uk/download/pdf/21173011.pdf| Moggi 1991, Notions of computation and monads]

[https://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf| Wadler 1992, Monads for functional programming]