module Cat.Diagram.Comonad 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 More generally, we can define what it means to equip a fixed functor with the structure of a comonad.

  record Comonad-on (W : Functor C C) : Type (o  ) where
    field
      counit : W => Id
      comult : W => (W F∘ W)

We also have equations governing the counit and comultiplication. Unsurprisingly, these are dual to the equations of a monad.

    field
      δ-unitl :  {x}  W₁ (ε x)  δ x  id
      δ-unitr :  {x}  ε (W₀ x)  δ x  id
      δ-assoc :  {x}  W₁ (δ x)  δ x  δ (W₀ x)  δ x