The Kleisli construction on the Type category #
Define the Kleisli category for (control) monads.
CategoryTheory/Monad/Kleisli defines the general version for a monad on C, and demonstrates
the equivalence between the two.
TODO #
Generalise this to work with CategoryTheory.Monad
The Kleisli category on the (type-)monad m. Note that the monad is not assumed to be lawful
yet.
Instances For
Construct an object of the Kleisli category from a type.
Instances For
@[implicit_reducible]
theorem
CategoryTheory.KleisliCat.ext
{m : Type u → Type v}
[_root_.Monad m]
(α β : KleisliCat m)
(f g : α ⟶ β)
(h : ∀ (x : α), f x = g x)
:
f = g
theorem
CategoryTheory.KleisliCat.ext_iff
{m : Type u → Type v}
[_root_.Monad m]
{α β : KleisliCat m}
{f g : α ⟶ β}
:
f = g ↔ ∀ (x : α), f x = g x
@[implicit_reducible]
instance
CategoryTheory.KleisliCat.category
{m : Type u → Type v}
[_root_.Monad m]
[LawfulMonad m]
:
@[simp]
theorem
CategoryTheory.KleisliCat.id_def
{m : Type u_1 → Type u_2}
[_root_.Monad m]
(α : KleisliCat m)
:
CategoryStruct.id α = pure
theorem
CategoryTheory.KleisliCat.comp_def
{m : Type u_1 → Type u_2}
[_root_.Monad m]
(α β γ : KleisliCat m)
(xs : α ⟶ β)
(ys : β ⟶ γ)
(a : α)
:
CategoryStruct.comp xs ys a = xs a >>= ys
@[implicit_reducible]
@[implicit_reducible]
instance
CategoryTheory.instInhabitedMkId
{α : Type u}
[Inhabited α]
:
Inhabited (KleisliCat.mk id α)