Copyright  (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 

License  BSDstyle (see the file LICENSE) 
Maintainer  [email protected] 
Stability  experimental 
Portability  portable 
Safe Haskell  Safe 
Language  Haskell98 
Declaration of the ReaderT
monad transformer, which adds a static environment to a given monad.
If the computation is to modify the stored information, use Control.Monad.Trans.State instead.
type Reader r = ReaderT r Identity Source
The parameterizable reader monad.
Computations are functions of a shared environment.
The return
function ignores the environment, while >>=
passes the inherited environment to both subcomputations.
reader :: Monad m => (r > a) > ReaderT r m a Source
Constructor for computations in the reader monad (equivalent to asks
).
:: Reader r a  A 
> r  An initial environment. 
> a 
Runs a Reader
and extracts the final value from it. (The inverse of reader
.)
mapReader :: (a > b) > Reader r a > Reader r b Source
Transform the value returned by a Reader
.
:: (r' > r)  The function to modify the environment. 
> Reader r a  Computation to run in the modified environment. 
> Reader r' a 
Execute a computation in a modified environment (a specialization of withReaderT
).
runReader
(withReader
f m) =runReader
m . f
The reader monad transformer, which adds a readonly environment to the given monad.
The return
function ignores the environment, while >>=
passes the inherited environment to both subcomputations.
ReaderT  
Fields

MonadTrans (ReaderT r)  
Monad m => Monad (ReaderT r m)  
Functor m => Functor (ReaderT r m)  
MonadFix m => MonadFix (ReaderT r m)  
Applicative m => Applicative (ReaderT r m)  
Alternative m => Alternative (ReaderT r m)  
MonadPlus m => MonadPlus (ReaderT r m)  
MonadIO m => MonadIO (ReaderT r m) 
mapReaderT :: (m a > n b) > ReaderT r m a > ReaderT r n b Source
Transform the computation inside a ReaderT
.
runReaderT
(mapReaderT
f m) = f .runReaderT
m
:: (r' > r)  The function to modify the environment. 
> ReaderT r m a  Computation to run in the modified environment. 
> ReaderT r' m a 
Execute a computation in a modified environment (a more general version of local
).
runReaderT
(withReaderT
f m) =runReaderT
m . f
ask :: Monad m => ReaderT r m r Source
Fetch the value of the environment.
:: Monad m  
=> (r > r)  The function to modify the environment. 
> ReaderT r m a  Computation to run in the modified environment. 
> ReaderT r m a 
Execute a computation in a modified environment (a specialization of withReaderT
).
runReaderT
(local
f m) =runReaderT
m . f
:: Monad m  
=> (r > a)  The selector function to apply to the environment. 
> ReaderT r m a 
Retrieve a function of the current environment.
liftCallCC :: CallCC m a b > CallCC (ReaderT r m) a b Source
Lift a callCC
operation to the new monad.
liftCatch :: Catch e m a > Catch e (ReaderT r m) a Source
Lift a catchE
operation to the new monad.
© The University of Glasgow and others
Licensed under a BSDstyle license (see top of the page).
https://downloads.haskell.org/~ghc/7.10.3/docs/html/libraries/transformers0.4.2.0/ControlMonadTransReader.html