ForkableT-0.1.0.2: Forkable monad transformers

Safe HaskellSafe
LanguageHaskell98

Control.Concurrent.ForkableT

Description

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.

Synopsis

Documentation

class ForkableT t where Source

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

Minimal complete definition

Nothing

Methods

forkT :: Forkable m n => t n () -> t m ThreadId Source

Instances

class (MonadIO m, MonadIO n) => Forkable m n where Source

Forkable. The default instance uses ForkableT and simply calls forkT

Minimal complete definition

Nothing

Methods

fork :: n () -> m ThreadId Source

Instances

Forkable IO IO 
(MonadBaseControl IO m, MonadIO m) => Forkable (ResourceT m) (ResourceT m) 
(Forkable m n, Error e) => Forkable (ErrorT e m) (ErrorT e n) 
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)