Reader Monad
(Redirected from reader monad)
Jump to navigation
Jump to search
A Reader Monad is a monad/state monad that ...
- …
- Counter-Example(s):
- threading a software argument through your software program.
- a State Monad.
- a Writer Monad.
- an I/O Monad.
- a Transformer Monad.
- See: State Reader Monad, Environment Variable, Reader Function.
References
2013
- http://stackoverflow.com/questions/14178889/reader-monad-purpose
- … the reader monad is some abstract type
data Reader env a
such that ...
- … the reader monad is some abstract type
2009
- http://www.haskell.org/haskellwiki/All_About_Monads#The_Reader_monad
- QUOTE: … Some programming problems require computations within a shared environment (such as a set of variable bindings). These computations typically read values from the environment and sometimes execute sub-computations in a modified environment (with new or shadowing bindings, for example), but they do not require the full generality of the State monad.
The Reader monad is specifically designed for these types of computations and is often a clearer and easier mechanism than using the State monad. …
… The definition shown here uses multi-parameter type classes and funDeps, which are not standard Haskell 98. It is not necessary to fully understand these details to make use of the Reader monad.
- QUOTE: … Some programming problems require computations within a shared environment (such as a set of variable bindings). These computations typically read values from the environment and sometimes execute sub-computations in a modified environment (with new or shadowing bindings, for example), but they do not require the full generality of the State monad.