monad-unlift-0.2.0: Typeclasses for representing monad transformer unlifting

Safe Haskell | Safe
Language | Haskell2010

Control.Monad.Trans.Unlift

Contents

- Trans
- Base
- Reexports

Description

See overview in the README.md

Synopsis

- class (MonadTransControl t, Forall (Identical t)) => MonadTransUnlift t
- newtype Unlift t = Unlift {
  - unlift :: forall a n. Monad n => t n a -> n a
  }
- askUnlift :: forall t m. (MonadTransUnlift t, Monad m) => t m (Unlift t)
- askRun :: (MonadTransUnlift t, Monad (t m), Monad m) => t m (t m a -> m a)
- class (MonadBaseControl b m, Forall (IdenticalBase m)) => MonadBaseUnlift b m | m -> b
- newtype UnliftBase b m = UnliftBase {
  - unliftBase :: forall a. m a -> b a
  }
- askUnliftBase :: forall b m. MonadBaseUnlift b m => m (UnliftBase b m)
- askRunBase :: MonadBaseUnlift b m => m (m a -> b a)
- class MonadTrans (t :: (Type -> Type) -> Type -> Type) where
  - lift :: Monad m => m a -> t m a
- class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: Type -> Type) (m :: Type -> Type) | m -> b where
  - liftBase :: b α -> m α
- class MonadTrans t => MonadTransControl (t :: (Type -> Type) -> Type -> Type) where
  - type StT (t :: (Type -> Type) -> Type -> Type) a
  - liftWith :: Monad m => (Run t -> m a) -> t m a
  - restoreT :: Monad m => m (StT t a) -> t m a
- class MonadBase b m => MonadBaseControl (b :: Type -> Type) (m :: Type -> Type) | m -> b where
  - type StM (m :: Type -> Type) a
  - liftBaseWith :: (RunInBase m b -> b a) -> m a
  - restoreM :: StM m a -> m a

# Trans

class (MonadTransControl t, Forall (Identical t)) => MonadTransUnlift t Source #

A monad transformer which can be unlifted, obeying the monad morphism laws.

Since 0.1.0

#### Instances

Instances details

(MonadTransControl t, Forall (Identical t)) => MonadTransUnlift t Source # |
Instance details Defined in Control.Monad.Trans.Unlift

newtype Unlift t Source #

A function which can move an action down the monad transformer stack, by providing any necessary environment to the action.

Note that, if ImpredicativeTypes worked reliably, this type wouldn't be necessary, and `askUnlift` would simply include a more generalized type.

Since 0.1.0

Constructors

Unlift |

Fields

- unlift :: forall a n. Monad n => t n a -> n a

askUnlift :: forall t m. (MonadTransUnlift t, Monad m) => t m (Unlift t) Source #

Get the `Unlift` action for the current transformer layer.

Since 0.1.0

askRun :: (MonadTransUnlift t, Monad (t m), Monad m) => t m (t m a -> m a) Source #

A simplified version of `askUnlift` which addresses the common case where polymorphism isn't necessary.

Since 0.1.0

# Base

class (MonadBaseControl b m, Forall (IdenticalBase m)) => MonadBaseUnlift b m | m -> b Source #

A monad transformer stack which can be unlifted, obeying the monad morphism laws.

Since 0.1.0

#### Instances

Instances details

(MonadBaseControl b m, Forall (IdenticalBase m)) => MonadBaseUnlift b m Source # |
Instance details Defined in Control.Monad.Trans.Unlift

newtype UnliftBase b m Source #

Similar to `Unlift`, but instead of moving one layer down the stack, moves the action to the base monad.

Since 0.1.0

Constructors

UnliftBase |

Fields

- unliftBase :: forall a. m a -> b a

askUnliftBase :: forall b m. MonadBaseUnlift b m => m (UnliftBase b m) Source #

Get the `UnliftBase` action for the current transformer stack.

Since 0.1.0

askRunBase :: MonadBaseUnlift b m => m (m a -> b a) Source #

A simplified version of `askUnliftBase` which addresses the common case where polymorphism isn't necessary.

Since 0.1.0

# Reexports

class MonadTrans (t :: (Type -> Type) -> Type -> Type) where #

Methods

lift :: Monad m => m a -> t m a #

#### Instances

Instances details

MonadTrans ListT |
Instance details Defined in Control.Monad.Trans.List Methods lift :: Monad m => m a -> ListT m a #
MonadTrans MaybeT |
Instance details Defined in Control.Monad.Trans.Maybe Methods lift :: Monad m => m a -> MaybeT m a #
Monoid w => MonadTrans (WriterT w) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods lift :: Monad m => m a -> WriterT w m a #
MonadTrans (StateT s) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods lift :: Monad m => m a -> StateT s m a #
MonadTrans (ReaderT r) |
Instance details Defined in Control.Monad.Trans.Reader Methods lift :: Monad m => m a -> ReaderT r m a #
MonadTrans (ExceptT e) |
Instance details Defined in Control.Monad.Trans.Except Methods lift :: Monad m => m a -> ExceptT e m a #
MonadTrans (ErrorT e) |
Instance details Defined in Control.Monad.Trans.Error Methods lift :: Monad m => m a -> ErrorT e m a #
MonadTrans (IdentityT :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Trans.Identity Methods lift :: Monad m => m a -> IdentityT m a #
Monoid w => MonadTrans (AccumT w) |
Instance details Defined in Control.Monad.Trans.Accum Methods lift :: Monad m => m a -> AccumT w m a #
MonadTrans (SelectT r) |
Instance details Defined in Control.Monad.Trans.Select Methods lift :: Monad m => m a -> SelectT r m a #
MonadTrans (StateT s) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods lift :: Monad m => m a -> StateT s m a #
Monoid w => MonadTrans (WriterT w) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods lift :: Monad m => m a -> WriterT w m a #
MonadTrans (ContT r) |
Instance details Defined in Control.Monad.Trans.Cont Methods lift :: Monad m => m a -> ContT r m a #
Monoid w => MonadTrans (RWST r w s) |
Instance details Defined in Control.Monad.Trans.RWS.Lazy Methods lift :: Monad m => m a -> RWST r w s m a #
Monoid w => MonadTrans (RWST r w s) |
Instance details Defined in Control.Monad.Trans.RWS.Strict Methods lift :: Monad m => m a -> RWST r w s m a #

class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: Type -> Type) (m :: Type -> Type) | m -> b where Source #

Methods

liftBase :: b α -> m α Source #

Lift a computation from the base monad

#### Instances

Instances details

MonadBase [] [] |
Instance details Defined in Control.Monad.Base Methods liftBase :: [α] -> [α] Source #
MonadBase Maybe Maybe |
Instance details Defined in Control.Monad.Base Methods liftBase :: Maybe α -> Maybe α Source #
MonadBase IO IO |
Instance details Defined in Control.Monad.Base Methods liftBase :: IO α -> IO α Source #
MonadBase STM STM |
Instance details Defined in Control.Monad.Base Methods liftBase :: STM α -> STM α Source #
MonadBase Identity Identity |
Instance details Defined in Control.Monad.Base Methods liftBase :: Identity α -> Identity α Source #
MonadBase b m => MonadBase b (MaybeT m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> MaybeT m α Source #
MonadBase b m => MonadBase b (ListT m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ListT m α Source #
(Monoid w, MonadBase b m) => MonadBase b (WriterT w m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> WriterT w m α Source #
(Monoid w, MonadBase b m) => MonadBase b (WriterT w m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> WriterT w m α Source #
MonadBase b m => MonadBase b (StateT s m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> StateT s m α Source #
MonadBase b m => MonadBase b (StateT s m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> StateT s m α Source #
MonadBase b m => MonadBase b (SelectT r m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> SelectT r m α Source #
MonadBase b m => MonadBase b (ReaderT r m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ReaderT r m α Source #
MonadBase b m => MonadBase b (IdentityT m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> IdentityT m α Source #
MonadBase b m => MonadBase b (ExceptT e m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ExceptT e m α Source #
(Error e, MonadBase b m) => MonadBase b (ErrorT e m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ErrorT e m α Source #
(Monoid w, MonadBase b m) => MonadBase b (AccumT w m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> AccumT w m α Source #
MonadBase b m => MonadBase b (ContT r m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ContT r m α Source #
(Monoid w, MonadBase b m) => MonadBase b (RWST r w s m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> RWST r w s m α Source #
(Monoid w, MonadBase b m) => MonadBase b (RWST r w s m) |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> RWST r w s m α Source #
MonadBase (Either e) (Either e) |
Instance details Defined in Control.Monad.Base Methods liftBase :: Either e α -> Either e α Source #
MonadBase (ST s) (ST s) |
Instance details Defined in Control.Monad.Base Methods liftBase :: ST s α -> ST s α Source #
MonadBase (ST s) (ST s) |
Instance details Defined in Control.Monad.Base Methods liftBase :: ST s α -> ST s α Source #
MonadBase ((->) r :: Type -> Type) ((->) r :: Type -> Type) |
Instance details Defined in Control.Monad.Base Methods liftBase :: (r -> α) -> r -> α Source #

class MonadTrans t => MonadTransControl (t :: (Type -> Type) -> Type -> Type) where Source #

The `MonadTransControl` type class is a stronger version of ``MonadTrans``:

Instances of ``MonadTrans`` know how to ``lift`` actions in the base monad to the transformed monad. These lifted actions, however, are completely unaware of the monadic state added by the transformer.

``MonadTransControl`` instances are aware of the monadic state of the transformer and allow to save and restore this state.

This allows to lift functions that have a monad transformer in both positive and negative position. Take, for example, the function

    withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r

``MonadTrans`` instances can only lift the return type of the `withFile` function:

    withFileLifted :: MonadTrans t => FilePath -> IOMode -> (Handle -> IO r) -> t IO r
    withFileLifted file mode action = lift (withFile file mode action)

However, ``MonadTrans`` is not powerful enough to make `withFileLifted` accept a function that returns `t IO`. The reason is that we need to take away the transformer layer in order to pass the function to ``withFile``. ``MonadTransControl`` allows us to do this:

    withFileLifted' :: (Monad (t IO), MonadTransControl t) => FilePath -> IOMode -> (Handle -> t IO r) -> t IO r
    withFileLifted' file mode action = liftWith (\run -> withFile file mode (run . action)) >>= restoreT . return

Associated Types

type StT (t :: (Type -> Type) -> Type -> Type) a Source #

Monadic state of `t`.

The monadic state of a monad transformer is the result type of its `run` function, e.g.:

    runReaderT :: ReaderT r m a -> r -> m a
    StT (ReaderT r) a ~ a

    runStateT :: StateT s m a -> s -> m (a, s)
    StT (StateT s) a ~ (a, s)

    runMaybeT :: MaybeT m a -> m (Maybe a)
    StT MaybeT a ~ Maybe a

Provided type instances:

    StT IdentityT    a ~ a
    StT MaybeT       a ~ Maybe a
    StT (ErrorT e)   a ~ Error e => Either e a
    StT (ExceptT e)  a ~ Either e a
    StT ListT        a ~ [a]
    StT (ReaderT r)  a ~ a
    StT (StateT s)   a ~ (a, s)
    StT (WriterT w)  a ~ Monoid w => (a, w)
    StT (RWST r w s) a ~ Monoid w => (a, s, w)

Methods

liftWith :: Monad m => (Run t -> m a) -> t m a Source #

`liftWith` is similar to `lift` in that it lifts a computation from the argument monad to the constructed monad.

Instances should satisfy similar laws as the `MonadTrans` laws:

    liftWith . const . return = return

    liftWith (const (m >>= f)) = liftWith (const m) >>= liftWith . const . f

The difference with `lift` is that before lifting the `m` computation `liftWith` captures the state of `t`. It then provides the `m` computation with a `Run` function that allows running `t n` computations in `n` (for all `n`) on the captured state, e.g.

    withFileLifted :: (Monad (t IO), MonadTransControl t) => FilePath -> IOMode -> (Handle -> t IO r) -> t IO r
    withFileLifted file mode action = liftWith (\run -> withFile file mode (run . action)) >>= restoreT . return

If the `Run` function is ignored, `liftWith` coincides with `lift`:

    lift f = liftWith (const f)

Implementations use the ``Run`` function associated with a transformer:

    liftWith :: Monad m => ((Monad n => ReaderT r n b -> n b) -> m a) -> ReaderT r m a
    liftWith f = ReaderT (r -> f (action -> runReaderT action r))

    liftWith :: Monad m => ((Monad n => StateT s n b -> n (b, s)) -> m a) -> StateT s m a
    liftWith f = StateT (s -> liftM (x -> (x, s)) (f (action -> runStateT action s)))

    liftWith :: Monad m => ((Monad n => MaybeT n b -> n (Maybe b)) -> m a) -> MaybeT m a
    liftWith f = MaybeT (liftM Just (f runMaybeT))

restoreT :: Monad m => m (StT t a) -> t m a Source #

Construct a `t` computation from the monadic state of `t` that is returned from a `Run` function.

Instances should satisfy:

    liftWith (\run -> run t) >>= restoreT . return = t

`restoreT` is usually implemented through the constructor of the monad transformer:

    ReaderT  :: (r -> m a) -> ReaderT r m a
    restoreT ::       m a  -> ReaderT r m a
    restoreT action = ReaderT { runReaderT = const action }

    StateT   :: (s -> m (a, s)) -> StateT s m a
    restoreT ::       m (a, s)  -> StateT s m a
    restoreT action = StateT { runStateT = const action }

    MaybeT   :: m (Maybe a) -> MaybeT m a
    restoreT :: m (Maybe a) -> MaybeT m a
    restoreT action = MaybeT action

Example type signatures:

    restoreT :: Monad m             => m a            -> IdentityT m a
    restoreT :: Monad m             => m (Maybe a)    -> MaybeT m a
    restoreT :: (Monad m, Error e)  => m (Either e a) -> ErrorT e m a
    restoreT :: Monad m             => m (Either e a) -> ExceptT e m a
    restoreT :: Monad m             => m [a]          -> ListT m a
    restoreT :: Monad m             => m a            -> ReaderT r m a
    restoreT :: Monad m             => m (a, s)       -> StateT s m a
    restoreT :: (Monad m, Monoid w) => m (a, w)       -> WriterT w m a
    restoreT :: (Monad m, Monoid w) => m (a, s, w)    -> RWST r w s m a

#### Instances

Instances details

MonadTransControl ListT |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT ListT a Source # Methods liftWith :: Monad m => (Run ListT -> m a) -> ListT m a Source # restoreT :: Monad m => m (StT ListT a) -> ListT m a Source #
MonadTransControl MaybeT |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT MaybeT a Source # Methods liftWith :: Monad m => (Run MaybeT -> m a) -> MaybeT m a Source # restoreT :: Monad m => m (StT MaybeT a) -> MaybeT m a Source #
Monoid w => MonadTransControl (WriterT w) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (WriterT w) a Source # Methods liftWith :: Monad m => (Run (WriterT w) -> m a) -> WriterT w m a Source # restoreT :: Monad m => m (StT (WriterT w) a) -> WriterT w m a Source #
MonadTransControl (StateT s) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (StateT s) a Source # Methods liftWith :: Monad m => (Run (StateT s) -> m a) -> StateT s m a Source # restoreT :: Monad m => m (StT (StateT s) a) -> StateT s m a Source #
MonadTransControl (ReaderT r) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (ReaderT r) a Source # Methods liftWith :: Monad m => (Run (ReaderT r) -> m a) -> ReaderT r m a Source # restoreT :: Monad m => m (StT (ReaderT r) a) -> ReaderT r m a Source #
MonadTransControl (ExceptT e) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (ExceptT e) a Source # Methods liftWith :: Monad m => (Run (ExceptT e) -> m a) -> ExceptT e m a Source # restoreT :: Monad m => m (StT (ExceptT e) a) -> ExceptT e m a Source #
Error e => MonadTransControl (ErrorT e) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (ErrorT e) a Source # Methods liftWith :: Monad m => (Run (ErrorT e) -> m a) -> ErrorT e m a Source # restoreT :: Monad m => m (StT (ErrorT e) a) -> ErrorT e m a Source #
MonadTransControl (IdentityT :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT IdentityT a Source # Methods liftWith :: Monad m => (Run IdentityT -> m a) -> IdentityT m a Source # restoreT :: Monad m => m (StT IdentityT a) -> IdentityT m a Source #
MonadTransControl (StateT s) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (StateT s) a Source # Methods liftWith :: Monad m => (Run (StateT s) -> m a) -> StateT s m a Source # restoreT :: Monad m => m (StT (StateT s) a) -> StateT s m a Source #
Monoid w => MonadTransControl (WriterT w) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (WriterT w) a Source # Methods liftWith :: Monad m => (Run (WriterT w) -> m a) -> WriterT w m a Source # restoreT :: Monad m => m (StT (WriterT w) a) -> WriterT w m a Source #
Monoid w => MonadTransControl (RWST r w s) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (RWST r w s) a Source # Methods liftWith :: Monad m => (Run (RWST r w s) -> m a) -> RWST r w s m a Source # restoreT :: Monad m => m (StT (RWST r w s) a) -> RWST r w s m a Source #
Monoid w => MonadTransControl (RWST r w s) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StT (RWST r w s) a Source # Methods liftWith :: Monad m => (Run (RWST r w s) -> m a) -> RWST r w s m a Source # restoreT :: Monad m => m (StT (RWST r w s) a) -> RWST r w s m a Source #

class MonadBase b m => MonadBaseControl (b :: Type -> Type) (m :: Type -> Type) | m -> b where Source #

## Writing instances

The usual way to write a ``MonadBaseControl`` instance for a transformer stack over a base monad `B` is to write an instance `MonadBaseControl B B` for the base monad, and `MonadTransControl T` instances for every transformer `T`. Instances for ``MonadBaseControl`` are then simply implemented using ``ComposeSt``, ``defaultLiftBaseWith``, ``defaultRestoreM``.

Associated Types

type StM (m :: Type -> Type) a Source #

Monadic state that `m` adds to the base monad `b`.

For all base (non-transformed) monads, `StM m a ~ a`:

    StM IO         a ~ a
    StM Maybe      a ~ a
    StM (Either e) a ~ a
    StM []         a ~ a
    StM ((->) r)   a ~ a
    StM Identity   a ~ a
    StM STM        a ~ a
    StM (ST s)     a ~ a

If `m` is a transformed monad, `m ~ t b`, ``StM`` is the monadic state of the transformer `t` (given by its `StT` from `MonadTransControl`). For a transformer stack, ``StM`` is defined recursively:

    StM (IdentityT  m) a ~ ComposeSt IdentityT m a ~ StM m a
    StM (MaybeT     m) a ~ ComposeSt MaybeT    m a ~ StM m (Maybe a)
    StM (ErrorT e   m) a ~ ComposeSt ErrorT    m a ~ Error e => StM m (Either e a)
    StM (ExceptT e  m) a ~ ComposeSt ExceptT   m a ~ StM m (Either e a)
    StM (ListT      m) a ~ ComposeSt ListT     m a ~ StM m [a]
    StM (ReaderT r  m) a ~ ComposeSt ReaderT   m a ~ StM m a
    StM (StateT s   m) a ~ ComposeSt StateT    m a ~ StM m (a, s)
    StM (WriterT w  m) a ~ ComposeSt WriterT   m a ~ Monoid w => StM m (a, w)
    StM (RWST r w s m) a ~ ComposeSt RWST      m a ~ Monoid w => StM m (a, s, w)

Methods

liftBaseWith :: (RunInBase m b -> b a) -> m a Source #

`liftBaseWith` is similar to `liftIO` and `liftBase` in that it lifts a base computation to the constructed monad.

Instances should satisfy similar laws as the `MonadIO` and `MonadBase` laws:

    liftBaseWith . const . return = return

    liftBaseWith (const (m >>= f)) = liftBaseWith (const m) >>= liftBaseWith . const . f

The difference with `liftBase` is that before lifting the base computation `liftBaseWith` captures the state of `m`. It then provides the base computation with a `RunInBase` function that allows running `m` computations in the base monad on the captured state:

    withFileLifted :: MonadBaseControl IO m => FilePath -> IOMode -> (Handle -> m a) -> m a
    withFileLifted file mode action = liftBaseWith (\runInBase -> withFile file mode (runInBase . action)) >>= restoreM
                                 -- = control $ \runInBase -> withFile file mode (runInBase . action)
                                 -- = liftBaseOp (withFile file mode) action

``liftBaseWith`` is usually not implemented directly, but using ``defaultLiftBaseWith``.

restoreM :: StM m a -> m a Source #

Construct a `m` computation from the monadic state of `m` that is returned from a `RunInBase` function.

Instances should satisfy:

    liftBaseWith (\runInBase -> runInBase m) >>= restoreM = m

``restoreM`` is usually not implemented directly, but using ``defaultRestoreM``.

#### Instances

Instances details

MonadBaseControl [] [] |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM [] a Source # Methods liftBaseWith :: (RunInBase [] [] -> [a]) -> [a] Source # restoreM :: StM [] a -> [a] Source #
MonadBaseControl Maybe Maybe |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM Maybe a Source # Methods liftBaseWith :: (RunInBase Maybe Maybe -> Maybe a) -> Maybe a Source # restoreM :: StM Maybe a -> Maybe a Source #
MonadBaseControl IO IO |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM IO a Source # Methods liftBaseWith :: (RunInBase IO IO -> IO a) -> IO a Source # restoreM :: StM IO a -> IO a Source #
MonadBaseControl STM STM |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM STM a Source # Methods liftBaseWith :: (RunInBase STM STM -> STM a) -> STM a Source # restoreM :: StM STM a -> STM a Source #
MonadBaseControl Identity Identity |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM Identity a Source # Methods liftBaseWith :: (RunInBase Identity Identity -> Identity a) -> Identity a Source # restoreM :: StM Identity a -> Identity a Source #
MonadBaseControl b m => MonadBaseControl b (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (MaybeT m) a Source # Methods liftBaseWith :: (RunInBase (MaybeT m) b -> b a) -> MaybeT m a Source # restoreM :: StM (MaybeT m) a -> MaybeT m a Source #
MonadBaseControl b m => MonadBaseControl b (ListT m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (ListT m) a Source # Methods liftBaseWith :: (RunInBase (ListT m) b -> b a) -> ListT m a Source # restoreM :: StM (ListT m) a -> ListT m a Source #
(Monoid w, MonadBaseControl b m) => MonadBaseControl b (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (WriterT w m) a Source # Methods liftBaseWith :: (RunInBase (WriterT w m) b -> b a) -> WriterT w m a Source # restoreM :: StM (WriterT w m) a -> WriterT w m a Source #
(Monoid w, MonadBaseControl b m) => MonadBaseControl b (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (WriterT w m) a Source # Methods liftBaseWith :: (RunInBase (WriterT w m) b -> b a) -> WriterT w m a Source # restoreM :: StM (WriterT w m) a -> WriterT w m a Source #
MonadBaseControl b m => MonadBaseControl b (StateT s m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (StateT s m) a Source # Methods liftBaseWith :: (RunInBase (StateT s m) b -> b a) -> StateT s m a Source # restoreM :: StM (StateT s m) a -> StateT s m a Source #
MonadBaseControl b m => MonadBaseControl b (StateT s m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (StateT s m) a Source # Methods liftBaseWith :: (RunInBase (StateT s m) b -> b a) -> StateT s m a Source # restoreM :: StM (StateT s m) a -> StateT s m a Source #
MonadBaseControl b m => MonadBaseControl b (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (ReaderT r m) a Source # Methods liftBaseWith :: (RunInBase (ReaderT r m) b -> b a) -> ReaderT r m a Source # restoreM :: StM (ReaderT r m) a -> ReaderT r m a Source #
MonadBaseControl b m => MonadBaseControl b (IdentityT m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (IdentityT m) a Source # Methods liftBaseWith :: (RunInBase (IdentityT m) b -> b a) -> IdentityT m a Source # restoreM :: StM (IdentityT m) a -> IdentityT m a Source #
MonadBaseControl b m => MonadBaseControl b (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (ExceptT e m) a Source # Methods liftBaseWith :: (RunInBase (ExceptT e m) b -> b a) -> ExceptT e m a Source # restoreM :: StM (ExceptT e m) a -> ExceptT e m a Source #
(Error e, MonadBaseControl b m) => MonadBaseControl b (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (ErrorT e m) a Source # Methods liftBaseWith :: (RunInBase (ErrorT e m) b -> b a) -> ErrorT e m a Source # restoreM :: StM (ErrorT e m) a -> ErrorT e m a Source #
(Monoid w, MonadBaseControl b m) => MonadBaseControl b (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (RWST r w s m) a Source # Methods liftBaseWith :: (RunInBase (RWST r w s m) b -> b a) -> RWST r w s m a Source # restoreM :: StM (RWST r w s m) a -> RWST r w s m a Source #
(Monoid w, MonadBaseControl b m) => MonadBaseControl b (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (RWST r w s m) a Source # Methods liftBaseWith :: (RunInBase (RWST r w s m) b -> b a) -> RWST r w s m a Source # restoreM :: StM (RWST r w s m) a -> RWST r w s m a Source #
MonadBaseControl (Either e) (Either e) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (Either e) a Source # Methods liftBaseWith :: (RunInBase (Either e) (Either e) -> Either e a) -> Either e a Source # restoreM :: StM (Either e) a -> Either e a Source #
MonadBaseControl (ST s) (ST s) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (ST s) a Source # Methods liftBaseWith :: (RunInBase (ST s) (ST s) -> ST s a) -> ST s a Source # restoreM :: StM (ST s) a -> ST s a Source #
MonadBaseControl (ST s) (ST s) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM (ST s) a Source # Methods liftBaseWith :: (RunInBase (ST s) (ST s) -> ST s a) -> ST s a Source # restoreM :: StM (ST s) a -> ST s a Source #
MonadBaseControl ((->) r :: Type -> Type) ((->) r :: Type -> Type) |
Instance details Defined in Control.Monad.Trans.Control Associated Types type StM ((->) r) a Source # Methods liftBaseWith :: (RunInBase ((->) r) ((->) r) -> r -> a) -> r -> a Source # restoreM :: StM ((->) r) a -> r -> a Source #