Monad Transformer
   HOME
*





Monad Transformer
In functional programming, a monad transformer is 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). Definition A monad transformer consists of: # A type constructor t of kind (type theory), kind (* -> *) -> * -> * # Monad operations return and bind (or an equivalent formulation) for all t m where m is a monad, satisfying the Monad_(functional_programming)#Monad_laws, monad laws # An additional operation, lift :: m a -> t m a, satisfying the following laws: (the notation `bind` below indicates infix application): ## lift . return = ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Functional Programming
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declarative programming paradigm in which function definitions are Tree (data structure), trees of Expression (computer science), expressions that map Value (computer science), values to other values, rather than a sequence of Imperative programming, imperative Statement (computer science), statements which update the State (computer science), running state of the program. In functional programming, functions are treated as first-class citizens, meaning that they can be bound to names (including local Identifier (computer languages), identifiers), passed as Parameter (computer programming), arguments, and Return value, returned from other functions, just as any other data type can. This allows programs to be written in a Declarative programming, ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  



MORE