monadbi-0.1: Extract underlying monads from monad transformers

Portabilitynon-portable (uses ghc extensions)



MonadBi represents the relationship between monads that can be transformed into each other (atleast partially).

MonadBi acts as a superset of MonadTrans, and provides raise analogous to lift, which lifts underlying monads into the transformer. It also provides lower which is the opposite of lift, and extracts underlying monads from monad transformers.

Natural instances are provided for many Monad Transformers.


class (Monad m1, Monad m2) => MonadBi m1 m2 whereSource


raise :: m2 a -> m1 aSource

lower :: m1 a -> m1 (m2 a)Source


Monad m => MonadBi m m 
Monad m => MonadBi (ReaderT c m) m 
Monad m => MonadBi (StateT s (ReaderT c m)) m 
Monad m => MonadBi (StateT s m) m 

lazyIO :: MonadBi m IO => m a -> m aSource

collect :: MonadBi m IO => m a -> (a -> m b) -> m [b]Source

collectN :: MonadBi m IO => Int -> m a -> (a -> m b) -> m [b]Source