Morphisms Between Monads #
structure
MonadHom
(m : Type u → Type v)
[Pure m]
[Bind m]
(n : Type u → Type w)
[Pure n]
[Bind n]
:
Type (max (max (u + 1) v) w)
Structure to represent a well-behaved mapping between computations in two monads m and n.
This is similar to MonadLift but isn't a type-class but rather an actual object.
This is useful for non-canonical mappings that shouldn't be applied automatically in general.
We also enforce similar laws to LawfulMonadLift.
- toFun {α : Type u} : m α → n α
Instances For
@[simp]
theorem
MonadHom.mmap_seq
{m : Type u → Type v}
[Monad m]
{n : Type u → Type w}
[Monad n]
{α β : Type u}
[LawfulMonad m]
[LawfulMonad n]
(F : m →ᵐ n)
(x : m (α → β))
(y : m α)
:
@[simp]
theorem
MonadHom.mmap_seqLeft
{m : Type u → Type v}
[Monad m]
{n : Type u → Type w}
[Monad n]
{α β : Type u}
[LawfulMonad m]
[LawfulMonad n]
(F : m →ᵐ n)
(x : m α)
(y : m β)
:
@[simp]
theorem
MonadHom.mmap_seqRight
{m : Type u → Type v}
[Monad m]
{n : Type u → Type w}
[Monad n]
{α β : Type u}
[LawfulMonad m]
[LawfulMonad n]
(F : m →ᵐ n)
(x : m α)
(y : m β)
:
def
MonadHom.ofLift
(m n : Type u → Type v)
[Monad m]
[Monad n]
[MonadLift m n]
[LawfulMonadLift m n]
:
Construct a MonadHom from a lawful monad lift.