Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Control.Monad.Trans.Unlift
Description
See overview in the README.md
Synopsis
- class (MonadTransControl t, Forall (Identical t)) => MonadTransUnlift t
- newtype Unlift t = Unlift {}
- 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 :: (* -> *) -> * -> *) where
- class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: * -> *) (m :: * -> *) | m -> b where
- class MonadTrans t => MonadTransControl (t :: (* -> *) -> * -> *) where
- class MonadBase b m => MonadBaseControl (b :: * -> *) (m :: * -> *) | m -> b where
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
(MonadTransControl t, Forall (Identical t)) => MonadTransUnlift t Source # | |
Defined in Control.Monad.Trans.Unlift |
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
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
(MonadBaseControl b m, Forall (IdenticalBase m)) => MonadBaseUnlift b m Source # | |
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
|
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 :: (* -> *) -> * -> *) where #
The class of monad transformers. Instances should satisfy the
following laws, which state that lift
is a monad transformation:
Minimal complete definition
Methods
lift :: Monad m => m a -> t m a #
Lift a computation from the argument monad to the constructed monad.
Instances
class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: * -> *) (m :: * -> *) | m -> b where #
Minimal complete definition
Instances
class MonadTrans t => MonadTransControl (t :: (* -> *) -> * -> *) where #
Instances
MonadTransControl ListT | |
MonadTransControl MaybeT | |
Monoid w => MonadTransControl (WriterT w) | |
MonadTransControl (StateT s) | |
MonadTransControl (ExceptT e) | |
Error e => MonadTransControl (ErrorT e) | |
MonadTransControl (IdentityT :: (* -> *) -> * -> *) | |
MonadTransControl (StateT s) | |
Monoid w => MonadTransControl (WriterT w) | |
MonadTransControl (ReaderT r :: (* -> *) -> * -> *) | |
Monoid w => MonadTransControl (RWST r w s) | |
Monoid w => MonadTransControl (RWST r w s) | |
class MonadBase b m => MonadBaseControl (b :: * -> *) (m :: * -> *) | m -> b where #
Minimal complete definition