mtlx-0.1.3: Monad transformer library with type indexes, providing 'free' copies.

Portabilitynon-portable (multi-param classes, functional dependencies)
MaintainerMark Snyder,






data Index ix => ReaderX ix r a Source


ReaderX ix (r -> a) 


Index ix => MonadReaderX ix r (ReaderX ix r) 
Index ix => Monad (ReaderX ix r) 
Index ix => Functor (ReaderX ix r) 
Index ix => MonadFix (ReaderX ix r) 

runReaderX :: Index ix => ix -> ReaderX ix r a -> r -> aSource

mapReaderx :: Index ix => ix -> (a -> b) -> ReaderX ix r a -> ReaderX ix r bSource

withReaderx :: Index ix => ix -> (r' -> r) -> ReaderX ix r a -> ReaderX ix r' aSource

A more general version of local.

data Index ix => ReaderTX ix r m a Source

The reader monad transformer. Can be used to add environment reading functionality to other monads.


ReaderTX ix (r -> m a) 


(Index ix1, Index ix2, MonadReaderX ix1 r1 m) => MonadReaderX ix1 r1 (ReaderTX ix2 r2 m) 
(Monad m, Index ix) => MonadReaderX ix r (ReaderTX ix r m) 
(Index ixr, Index ixs, MonadStateX ixs s m) => MonadStateX ixs s (ReaderTX ixr r m) 
(Index ixr, MonadWriterX ixw w m) => MonadWriterX ixw w (ReaderTX ixr r m) 
(MonadReader r m, Index ix) => MonadReader r (ReaderTX ix r2 m) 
(Index ix, MonadState s m) => MonadState s (ReaderTX ix r m) 
(MonadError e m, Index ix) => MonadError e (ReaderTX ix r m) 
(Index ix, MonadWriter w m) => MonadWriter w (ReaderTX ix r m) 
Index ix => MonadTrans (ReaderTX ix r) 
(Monad m, Index ix) => Monad (ReaderTX ix r m) 
(Monad m, Index ix) => Functor (ReaderTX ix r m) 
(MonadFix m, Index ix) => MonadFix (ReaderTX ix r m) 
(MonadPlus m, Index ix) => MonadPlus (ReaderTX ix r m) 
(MonadCont m, Index ix) => MonadCont (ReaderTX ix r m) 
(MonadIO m, Index ix) => MonadIO (ReaderTX ix r m) 

runReaderTX :: Index ix => ix -> ReaderTX ix r m a -> r -> m aSource

mapReaderTX :: Index ix => ix -> (m a -> n b) -> ReaderTX ix w m a -> ReaderTX ix w n bSource

withReaderTX :: Index ix => ix -> (r' -> r) -> ReaderTX ix r m a -> ReaderTX ix r' m aSource