Category:Monads: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 19:
;the Writer monad
:Nests functions which return their output in an envelope that includes a log string. Nesting ('composing') such functions generates a concatenated log of a chain of function applications.
;the Maybe monad
:Nests partial functions which return their output in a wrapper that includes a boolean flag – indicating whether or not the input value was legal. Composition of these functions avoids the need for exception handling when an illegal value is encountered somewhere along the chain of function applications.
;the List monad
:Nests functions whose outputs consist of ranges of possible values, rather than single values. ThisComposing providesthese afunctions convenient encoding ofyields cartesian products, and a convenient encoding of set comprehensions.
 
 
9,655

edits