The Kleisli construction on the Type category #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Define the Kleisli category for (control) monads.
category_theory/monad/kleisli
defines the general version for a monad on C
, and demonstrates
the equivalence between the two.
TODO #
Generalise this to work with category_theory.monad
@[nolint]
The Kleisli category on the (type-)monad m
. Note that the monad is not assumed to be lawful
yet.
Equations
Instances for category_theory.Kleisli
Construct an object of the Kleisli category from a type.
Equations
- category_theory.Kleisli.mk m α = α
Instances for category_theory.Kleisli.mk
@[protected, instance]
Equations
- category_theory.Kleisli.category_struct = {to_quiver := {hom := λ (α β : category_theory.Kleisli m), α → m β}, id := λ (α : category_theory.Kleisli m) (x : α), has_pure.pure x, comp := λ (X Y Z : category_theory.Kleisli m) (f : X ⟶ Y) (g : Y ⟶ Z), f >=> g}
@[protected, instance]
Equations
- category_theory.Kleisli.category = {to_category_struct := category_theory.Kleisli.category_struct _inst_1, id_comp' := _, comp_id' := _, assoc' := _}
@[simp]
theorem
category_theory.Kleisli.id_def
{m : Type u_1 → Type u_2}
[monad m]
(α : category_theory.Kleisli m) :
𝟙 α = has_pure.pure
@[protected, instance]
Equations
@[protected, instance]
Equations
- category_theory.Kleisli.mk.inhabited = {default := show α, from inhabited.default}