Safe Haskell  None 

Language  Haskell2010 
The multivalued version of mtl's Reader / ReaderT
 newtype MultiReaderT x m a = MultiReaderT {
 runMultiReaderTRaw :: StateT (HList x) m a
 type MultiReaderTNull = MultiReaderT `[]`
 type MultiReader x = MultiReaderT x Identity
 class Monad m => MonadMultiReader a m where
 mAsk :: m a
 runMultiReaderT :: Monad m => HList r > MultiReaderT r m a > m a
 runMultiReaderT_ :: Functor m => HList r > MultiReaderT r m a > m ()
 runMultiReaderTNil :: Monad m => MultiReaderT `[]` m a > m a
 runMultiReaderTNil_ :: Functor m => MultiReaderT `[]` m a > m ()
 withMultiReader :: Monad m => r > MultiReaderT (r : rs) m a > MultiReaderT rs m a
 withMultiReader_ :: (Functor m, Monad m) => r > MultiReaderT (r : rs) m a > MultiReaderT rs m ()
 withMultiReaders :: Monad m => HList r1 > MultiReaderT (Append r1 r2) m a > MultiReaderT r2 m a
 withMultiReaders_ :: (Functor m, Monad m) => HList r1 > MultiReaderT (Append r1 r2) m a > MultiReaderT r2 m ()
 withoutMultiReader :: Monad m => MultiReaderT rs m a > MultiReaderT (r : rs) m a
 inflateReader :: (Monad m, ContainsType r rs) => ReaderT r m a > MultiReaderT rs m a
 mapMultiReaderT :: (m (a, HList w) > m' (a', HList w)) > MultiReaderT w m a > MultiReaderT w m' a'
 mGetRaw :: Monad m => MultiReaderT a m (HList a)
 mPutRaw :: Monad m => HList s > MultiReaderT s m ()
MultiReaderT
newtype MultiReaderT x m a Source
A Reader transformer monad patameterized by:
 x  The list of types constituting the environment / input (to be read),
 m  The inner monad.
MultiReaderT
corresponds to mtl's ReaderT
, but can contain
a heterogenous list of types.
This heterogenous list is represented using Types.Data.List, i.e:
'[]
 The empty list,a ': b
 A list wherea
is an arbitrary type andb
is the rest list.
For example,
MultiReaderT '[Int, Bool] :: (* > *) > (* > *)
is a Reader transformer containing the types [Int, Bool].
MultiReaderT  

MonadBase b m => MonadBase b (MultiReaderT r m) Source  
MonadBaseControl b m => MonadBaseControl b (MultiReaderT r m) Source  
MonadState s m => MonadState s (MultiReaderT c m) Source  
MonadWriter w m => MonadWriter w (MultiReaderT c m) Source  
(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source  
MonadTrans (MultiReaderT x) Source  
MonadTransControl (MultiReaderT r) Source  
Monad m => Monad (MultiReaderT x m) Source  
Functor f => Functor (MultiReaderT x f) Source  
MonadFix m => MonadFix (MultiReaderT r m) Source  
(Applicative m, Monad m) => Applicative (MultiReaderT x m) Source  
(Functor m, Applicative m, MonadPlus m) => Alternative (MultiReaderT c m) Source  
MonadPlus m => MonadPlus (MultiReaderT c m) Source  
MonadIO m => MonadIO (MultiReaderT c m) Source  
type StT (MultiReaderT r) a = (a, HList r) Source  
type StM (MultiReaderT r m) a = ComposeSt (MultiReaderT r) m a Source 
type MultiReaderTNull = MultiReaderT `[]` Source
A MultiReader transformer carrying an empty state.
type MultiReader x = MultiReaderT x Identity Source
A reader monad parameterized by the list of types x of the environment / input to carry.
Similar to Reader r = ReaderT r Identity
MonadMultiReader class
class Monad m => MonadMultiReader a m where Source
All methods must be defined.
The idea is: Any monad stack is instance of MonadMultiReader a
, iff
the stack contains a MultiReaderT x
with a element of x.
(MonadTrans t, Monad (t m), MonadMultiReader a m) => MonadMultiReader a (t m) Source  
(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source  
(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source  
(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source  
(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source 
runfunctions
runMultiReaderT :: Monad m => HList r > MultiReaderT r m a > m a Source
runMultiReaderT_ :: Functor m => HList r > MultiReaderT r m a > m () Source
runMultiReaderTNil :: Monad m => MultiReaderT `[]` m a > m a Source
runMultiReaderTNil_ :: Functor m => MultiReaderT `[]` m a > m () Source
withfunctions (single reader)
withMultiReader :: Monad m => r > MultiReaderT (r : rs) m a > MultiReaderT rs m a Source
withMultiReader_ :: (Functor m, Monad m) => r > MultiReaderT (r : rs) m a > MultiReaderT rs m () Source
withfunctions (multiple readers)
withMultiReaders :: Monad m => HList r1 > MultiReaderT (Append r1 r2) m a > MultiReaderT r2 m a Source
withMultiReaders_ :: (Functor m, Monad m) => HList r1 > MultiReaderT (Append r1 r2) m a > MultiReaderT r2 m () Source
withoutfunction (single reader)
withoutMultiReader :: Monad m => MultiReaderT rs m a > MultiReaderT (r : rs) m a Source
inflatefunction (run ReaderT in MultiReaderT)
inflateReader :: (Monad m, ContainsType r rs) => ReaderT r m a > MultiReaderT rs m a Source
other functions
mapMultiReaderT :: (m (a, HList w) > m' (a', HList w)) > MultiReaderT w m a > MultiReaderT w m' a' Source
Map both the return value and the environment of a computation using the given function.
Note that there is a difference to mtl's ReaderT, where it is not possible to modify the environment.
mGetRaw :: Monad m => MultiReaderT a m (HList a) Source
A raw extractor of the contained HList (i.e. the complete Reader).
mPutRaw :: Monad m => HList s > MultiReaderT s m () Source