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.
Equations
- CategoryTheory.KleisliCat x✝ = Type ?u.2
Instances For
Construct an object of the Kleisli category from a type.
Equations
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
theorem CategoryTheory.KleisliCat.ext {m : Type u → Type v} [Monad m] (α β : KleisliCat m) (f g : α ⟶ β) (h : ∀ (x : α), f x = g x) :
theorem CategoryTheory.KleisliCat.ext_iff {m : Type u → Type v} [Monad m] {α β : KleisliCat m} {f g : α ⟶ β} :
@[instance_reducible]
Equations
- CategoryTheory.KleisliCat.category = { toCategoryStruct := CategoryTheory.KleisliCat.categoryStruct, id_comp := ⋯, comp_id := ⋯, assoc := ⋯ }
@[simp]
theorem CategoryTheory.KleisliCat.comp_def {m : Type u_1 → Type u_2} [Monad m] (α β γ : KleisliCat m) (xs : α ⟶ β) (ys : β ⟶ γ) (a : α) :
@[instance_reducible]
Equations
- CategoryTheory.instInhabitedKleisliCatId = { default := PUnit.{?u.1 + 1} }
@[instance_reducible]
instance CategoryTheory.instInhabitedMkId {α : Type u} [Inhabited α] :
Inhabited (KleisliCat.mk id α)
Equations
- CategoryTheory.instInhabitedMkId = { default := have this := default; this }