Safe Haskell | Safe-Infered |
---|
Contains a class and instance for MonadIO implementations that can be run directly in MonadIO and | then reconstructed to the original type, without changing the overall semantics.
- class MonadIO m => MonadIOUnwrappable m where
- type MonadIOWrapType m :: * -> *
- type MonadIOStateType m :: *
- unwrapState :: m (MonadIOStateType m)
- unwrapMonadIO :: MonadIOStateType m -> m a -> IO (MonadIOWrapType m a)
- rewrapMonadIO :: MonadIOStateType m -> MonadIOWrapType m a -> m a
Documentation
class MonadIO m => MonadIOUnwrappable m whereSource
Represents a MonadIO where any change further up the monad stack can be | represented lower down in the stack.
type MonadIOWrapType m :: * -> *Source
type MonadIOStateType m :: *Source
unwrapState :: m (MonadIOStateType m)Source
Sets up state (e.g. an IORef) to be used to simulate the monad from the | IO monad.
unwrapMonadIO :: MonadIOStateType m -> m a -> IO (MonadIOWrapType m a)Source
Maps the monad to only use IO level constructs and the state set up | using unwrapState.
rewrapMonadIO :: MonadIOStateType m -> MonadIOWrapType m a -> m aSource
Reverses a previous unwrapMonadIO operation.
MonadIOUnwrappable IO | |
(Error e, MonadIO m, MonadIOUnwrappable m) => MonadIOUnwrappable (ErrorT e m) | |
(MonadIO m, MonadIOUnwrappable m) => MonadIOUnwrappable (ReaderT r m) | |
(MonadIO m, MonadIOUnwrappable m) => MonadIOUnwrappable (StateT r m) |