Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module duplicates the Control.Monad.Reader module from the mtl, for constrained monads.
- class Monad m => MonadReader r m | m -> r where
- type ReaderSuitable m a :: Constraint
- newtype ReaderT k r m a :: forall k. * -> (k -> *) -> k -> * = ReaderT {
- runReaderT :: r -> m a
- type Reader r = ReaderT * r Identity
Documentation
class Monad m => MonadReader r m | m -> r where Source #
A class for reader monads.
type ReaderSuitable m a :: Constraint Source #
ask :: ReaderSuitable m r => m r Source #
Retrieves the environment
local :: (ReaderSuitable m a, ReaderSuitable m r) => (r -> r) -> m a -> m a Source #
Executes a computation in a modified environment.
reader :: (ReaderSuitable m r, ReaderSuitable m a) => (r -> a) -> m a Source #
Retrieves a function of the current environment.
MonadReader r m => MonadReader r (MaybeT m) Source # | |
MonadReader r ((->) r) Source # | |
MonadReader r m => MonadReader r (StateT s m) Source # | |
MonadReader r m => MonadReader r (StateT s m) Source # | |
MonadReader r m => MonadReader r (IdentityT * m) Source # | |
MonadReader r m => MonadReader r (ExceptT e m) Source # | |
MonadReader r m => MonadReader r (WriterT w m) Source # | |
MonadReader r' m => MonadReader r' (ContT * r m) Source # | |
Monad m => MonadReader r (ReaderT * r m) Source # | |
newtype ReaderT k r m a :: forall k. * -> (k -> *) -> k -> * #
The reader monad transformer, which adds a read-only environment to the given monad.
The return
function ignores the environment, while >>=
passes
the inherited environment to both subcomputations.
ReaderT | |
|