Category:Monads: Difference between revisions

Content added Content deleted
mNo edit summary
No edit summary
Line 1: Line 1:
{{draft task}}
{{draft task}}
In functional programming, the [[wp:Monad_(functional_programming)|Monad]] pattern is a general solution to the problem of nesting (or 'composing') a class of functions which enclose their output values in some kind of useful wrapping. The output envelope might, for example, contain, in addition to the returned value, a log string, or a boolean indicator of whether or not the input was a legal value. Sometimes the output might simply be enclosed in a list representing a range of possible values rather than a single value.
In functional programming, the [[wp:Monad_(functional_programming)|Monad]] design pattern is a general solution to the problem of nesting (or 'composing') a class of functions which enclose their output values in some kind of useful wrapping. The output envelope might, for example, contain, in addition to the returned value, a log string, or a boolean indicator of whether or not the input was a legal value. Sometimes the output might simply be enclosed in a list representing a range of possible values rather than a single value.


Functions of this type can not be directly nested with each other, because their output type (wrapped) does not match their input type (raw and unwrapped).
Functions of this type can not be directly nested with each other, because their output type (wrapped) does not match their input type (raw and unwrapped).