ForkableT- Forkable monad transformers

Safe HaskellSafe



This module defines two classes. Forkable m n means a monad n may be forked in m. ForkableT t means that applying the transformer to n and m will mean you can still fork t n in t m.

The reason we need a separate class for monad transformers is because often times the "forkability" of a transformed monad does not depend on the underlying monad, only it's forkability. This is the case for example for most standard monad transformers.



class ForkableT t whereSource

ForkableT. The default instance uses MonadTransControl to lift the underlying fork


forkT :: Forkable m n => t n () -> t m ThreadIdSource


ForkableT (ReaderT r) 
ForkableT (StateT s) 
Error e => ForkableT (ErrorT e) 
Monoid w => ForkableT (WriterT w) 

class (MonadIO m, MonadIO n) => Forkable m n whereSource

Forkable. The default instance uses ForkableT and simply calls forkT


fork :: n () -> m ThreadIdSource


Forkable IO IO 
(MonadBaseControl IO m, MonadIO m) => Forkable (ResourceT m) (ResourceT m) 
Forkable m n => Forkable (ReaderT s m) (StateT s n) 
Forkable m n => Forkable (ReaderT r m) (ReaderT r n) 
Forkable m n => Forkable (StateT s m) (ReaderT s n) 
Forkable m n => Forkable (StateT s m) (StateT s n) 
(Forkable m n, Error e) => Forkable (ErrorT e m) (ErrorT e n)