Network-NineP- High-level abstraction over 9P protocol
PortabilityI'm too young to die
Safe HaskellSafe-Inferred



Provides one with the ability to pass her own monads in the callbacks.



class MonadIO o => EmbedIO o where Source #

MonadIOs that can be collapsed to and restored from a distinct value.

Associated Types

type Content o Source #

Intermediate state storage type.


embed :: (Content o -> IO a) -> o a Source #

Propagate an IO operation over the storage type to the monadic type.

callback :: o a -> Content o -> IO a Source #

Run the monadic computation using supplied state.


Instances details
EmbedIO IO Source # 
Instance details

Defined in Control.Monad.EmbedIO

Associated Types

type Content IO Source #


embed :: (Content IO -> IO a) -> IO a Source #

callback :: IO a -> Content IO -> IO a Source #

data Void Source #

Empty type. Used to represent state for IO monad.

bracketE :: EmbedIO m => m r -> (r -> m b) -> (r -> m a) -> m a Source #

bracket equivalent.

catchE :: (EmbedIO m, Exception e) => m a -> (e -> m a) -> m a Source #

catch equivalent.

handleE :: (EmbedIO m, Exception e) => (e -> m a) -> m a -> m a Source #

handle equivalent.

tryE :: (EmbedIO m, Exception e) => m a -> m (Either e a) Source #

try equivalent.

throwE :: (EmbedIO m, Exception e) => e -> m a Source #

throw equivalent.

forkE :: EmbedIO m => m () -> m ThreadId Source #

forkIO equivalent.