monad-wrap-0.1: Wrap functions such as catch around different monads

Safe HaskellSafe-Inferred




class Monad m => MonadWrapIO m a r | m a -> r whereSource

MonadWrapIO is analogous to MonadWrap, but where the wrapping function is always of type IO r -> IO r. The point of MonadWrapIO is to go through as many nested monad transformers as necessary to reach the IO monad, so you don't have to keep track of where you are in terms of monad nesting depth.


wrapIO :: (IO r -> IO r) -> m a -> m aSource

wrapIO is to wrap as liftIO is to lift.

resultFIO :: m (a -> r)Source

resultFIO is to resultF as liftIO is to lift.

resultIO :: a -> m rSource

resultIO is to result as liftIO is to lift.


MonadWrapIO IO a a 
(Monad m, MonadTrans t, Monad (t m), MonadWrapIO m ar r, MonadWrap t a ar) => MonadWrapIO (t m) a r