Monad transformer: Difference between revisions

Content deleted Content added
m neatness
edit 1st sentence for symmetry
Line 1:
{{Wikibooks|Haskell|Monad transformers}}
In [[functional programming]], a '''monad transformer''' is essentially a type constructor which takes a [[monads in functional programming|monad]] as an argument, and returns a monad as a result.
 
Monad transformers can be used to compose features encapsulated by monads - such as state, exception handling, and I/O - in a modular way. Typically, a monad transformer is created by generalising an existing monad; applying the resulting monad transformer to the identity monad yields a monad which is equivalent to the original monad (ignoring any necessary boxing and unboxing).