module Cat.Diagram.Comonad {o β} (C : Precategory o β) where
Comonadsπ
A comonad on a category is dual to a monad on instead of a unit and multiplication we have a counit and comultiplication
record Comonad : Type (o β β) where field W : Functor C C counit : W => Id comult : W => (W Fβ W)
module counit = _=>_ counit renaming (Ξ· to Ξ΅) module comult = _=>_ comult Wβ = W .Fβ Wβ = W .Fβ W-id = W .F-id W-β = W .F-β
We also have equations governing the counit and comultiplication. Unsurprisingly, these are dual to the equations of a monad.
field left-ident : β {x} β Wβ (counit.Ξ΅ x) β comult.Ξ· x β‘ id right-ident : β {x} β counit.Ξ΅ (Wβ x) β comult.Ξ· x β‘ id comult-assoc : β {x} β Wβ (comult.Ξ· x) β comult.Ξ· x β‘ comult.Ξ· (Wβ x) β comult.Ξ· x