The MonadTrans class abstracts the lift operation for monad transformers.
$$\text{lift} : m\ \alpha \to t\ m\ \alpha$$
Transforms a computation in the inner monad m into one in the
transformed monad t m.
Lift a computation from the inner monad into the transformer.
Instances
@[implicit_reducible]
@[implicit_reducible]
ReaderT lifts by ignoring the environment.
@[implicit_reducible]
StateT lifts by threading the state through unchanged.
theorem
Control.Monad.Trans.exceptT_lift_pure
{m : Type → Type}
{α ε : Type}
[Monad m]
[LawfulMonad m]
(a : α)
:
ExceptT.lift preserves pure: lift (pure a) = pure a.
$$\text{lift}(\text{pure}\ a) = \text{pure}\ a$$
theorem
Control.Monad.Trans.stateT_lift_pure
{m : Type → Type}
{α σ : Type}
[Monad m]
[LawfulMonad m]
(a : α)
:
StateT.lift preserves pure: lift (pure a) = pure a.
$$\text{lift}(\text{pure}\ a) = \text{pure}\ a$$