SimpleH-1.2: A light, clean and powerful Haskell utility library

Safe HaskellNone

Algebra.Monad.Reader

Contents

Synopsis

The Reader monad

class Monad m => MonadReader r m | m -> r whereSource

Methods

ask :: m rSource

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

Instances

MonadReader r ((->) r) 
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

Instances

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) 
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 aSource

_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