definitive-base-2.3: The base modules of the Definitive framework.

Safe HaskellNone




The Reader monad

class Monad m => MonadReader r m | m -> r where Source


ask :: m r Source

local :: (r -> r) -> m a -> m a Source


MonadReader r ((->) r) 
MonadReader r m => MonadReader r (Free m) 
(Traversable g, Monad g, MonadReader r f) => MonadReader r ((:.:) f g) 
(Traversable f, Monad f, MonadReader r g) => MonadReader r (Compose' f g) 
MonadReader r m => MonadReader r (StateT s m) 
Monad m => MonadReader r (ReaderT r m) 
(Monoid w, MonadReader r m) => MonadReader r (WriterT w m) 
(Monad m, Monoid w) => MonadReader r (RWST r w s m) 

data ReaderT r m a Source

A simple Reader monad


MonadCounter w acc m => MonadCounter w acc (ReaderT r m) 
(Monad m, MonadFuture n m) => MonadFuture n (ReaderT r m) 
MonadWriter w m => MonadWriter w (ReaderT r m) 
Monad m => MonadReader r (ReaderT r m) 
MonadState s m => MonadState s (ReaderT r m) 
MonadTrans (ReaderT r) 
MonadInternal (ReaderT r) 
Unit m => Unit (ReaderT r m) 
MonadCont m => MonadCont (ReaderT r m) 
MonadList m => MonadList (ReaderT r m) 
MonadFix m => MonadFix (ReaderT r m) 
Monad m => Monad (ReaderT r m) 
Monad m => Applicative (ReaderT r m) 
Functor m => Functor (ReaderT r m) 
Ring (m (a, Void, Void)) => Ring (ReaderT r m a) 
Semiring (m (a, Void, Void)) => Semiring (ReaderT r m a) 
Monoid (m (a, Void, Void)) => Monoid (ReaderT r m a) 
Semigroup (m (a, Void, Void)) => Semigroup (ReaderT r m a) 

type Reader r a = ReaderT r Id a Source

readerT :: (Functor m, Functor m') => Iso (ReaderT r m a) (ReaderT r' m' b) (r -> m a) (r' -> m' b) Source

reader :: Iso (Reader r a) (Reader r' b) (r -> a) (r' -> b) Source