MonadPeelIO is the class of IO-based monads supporting an
extra operation peelIO, enabling control operations on IO to be
lifted into the monad.
Methods
peelIO :: m (m a -> IO (m a))peelIOis a version of peel that operates through an arbitrary stack of monad transformers directly to an inner IO (analagously to how liftIO is a version oflift). So it can be used with liftIO to lift control operations on IO into any monad in MonadPeelIO. For example:foo :: IO a -> IO a foo' :: MonadPeelIO m => m a -> m a foo' a = do k <- peelIO -- k :: m a -> IO (m a) join $ liftIO $ foo (k a) -- uses foo :: IO (m a) -> IO (m a)Note that the "obvious" term of this type (
peelIO = return return) does not work correctly. Instances of MonadPeelIO should be constructed via MonadTransPeel, usingpeelIO = liftPeel peelIO.
Instances11MonadPeelIO, …
MonadPeelIO IODefined in monad-peel-0.3 · Control.Monad.IO.PeelMonadPeelIO m => MonadPeelIO (MaybeT m)Defined in monad-peel-0.3 · Control.Monad.IO.PeelMonadPeelIO m => MonadPeelIO (ExceptT e m)Defined in monad-peel-0.3 · Control.Monad.IO.PeelMonadPeelIO m => MonadPeelIO (IdentityT m)Defined in monad-peel-0.3 · Control.Monad.IO.PeelMonadPeelIO m => MonadPeelIO (ReaderT r m)Defined in monad-peel-0.3 · Control.Monad.IO.PeelMonadPeelIO m => MonadPeelIO (StateT s m)Defined in monad-peel-0.3 · Control.Monad.IO.PeelMonadPeelIO m => MonadPeelIO (StateT s m)Defined in monad-peel-0.3 · Control.Monad.IO.Peel(Monoid w, MonadPeelIO m) => MonadPeelIO (WriterT w m)Defined in monad-peel-0.3 · Control.Monad.IO.Peel(Monoid w, MonadPeelIO m) => MonadPeelIO (WriterT w m)Defined in monad-peel-0.3 · Control.Monad.IO.Peel(Monoid w, MonadPeelIO m) => MonadPeelIO (RWST r w s m)Defined in monad-peel-0.3 · Control.Monad.IO.Peel(Monoid w, MonadPeelIO m) => MonadPeelIO (RWST r w s m)Defined in monad-peel-0.3 · Control.Monad.IO.Peel