HORIZON HASKELLDocslts/ghc-10.0.xc7d136e2026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c7d136e · 2026-10-12

Modulemmorph-1.2.2

Control.Monad.Morph

  • 3 classes
  • 6 values
  • Packagemmorph-1.2.2
  • Exports9
  • LicenceBSD-3-Clause
  • SourceClass.hs
value(<|<)
  1. :: (Monad m3, MMonad t)
  2. => forall b. m2 b -> t m3 b
  3. -> forall a. m1 a -> t m2 a
  4. -> m1 c
  5. -> t m3 c
#
value(=<|) :: (Monad n, MMonad t) => (forall a. m a -> t n a) -> t m b -> t n b
#
value(>|>)
  1. :: (Monad m3, MMonad t)
  2. => forall a. m1 a -> t m2 a
  3. -> forall b. m2 b -> t m3 b
  4. -> m1 c
  5. -> t m3 c
#
value(|>=) :: (Monad n, MMonad t) => t m b -> (forall a. m a -> t n a) -> t n b
#
classclass MFunctor (t :: (Type -> Type) -> k -> Type) where
#

Methods

  • hoist :: Monad m => (forall a. m a -> n a) -> t m b -> t n b
Instances16MFunctor, …
classclass (MFunctor t, MonadTrans t) => MMonad (t :: (Type -> Type) -> Type -> Type) where
#

Methods

  • embed :: Monad n => (forall a. m a -> t n a) -> t m b -> t n b
Instances7MMonad, …
classclass (forall (m :: Type -> Type). Monad m => Monad (t m)) => MonadTrans (t :: (Type -> Type) -> Type -> Type) where
#

The class of monad transformers. For any monad m, the result t m should also be a monad, and lift should be a monad transformation from m to t m, i.e. it should satisfy the following laws:

Since 0.6.0.0 and for GHC 8.6 and later, the requirement that t m be a Monad is enforced by the implication constraint forall m. Monad m => Monad (t m) enabled by the QuantifiedConstraints extension.

Ambiguity error with GHC 9.0 to 9.2.2

These versions of GHC have a bug (https://gitlab.haskell.org/ghc/ghc/-/issues/20582) which causes constraints like

(MonadTrans t, forall m. Monad m => Monad (t m)) => ...

to be reported as ambiguous. For transformers 0.6 and later, this can be fixed by removing the second constraint, which is implied by the first.

Methods

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

    Lift a computation from the argument monad to the constructed monad.

Instances16MonadTrans, …