PS

Error monad

記法

  •  \mathcal{C} := \mathcal{Set} \text{ or } \mathcal{Hask}

Under category (Coslice category)

Error monad

Functor:

  •  F : \mathcal{C} \to {} ^ E \negthinspace / \mathcal{C}
  •  F( f: X \to Y) :=  \mathsf{id} _ E + f :  \mathsf{inl} ^ {E+X} \to \mathsf{inl} ^ {E+Y}

と forgetful functor:

  •  U : {} ^ E \negthinspace / \mathcal{C} \to \mathcal{C}

について

となるが、この adjunction の associated monaderror monad

Error monad transformer

Adjunction からの monad transformer - PS から functor:

  •  Q :  \mathcal{Mnd}({} ^ E \negthinspace / \mathcal{C}) \to \mathcal{Mnd}(\mathcal{C})

を作ると、Monad からの monad transformer - PS と同様の問題がおきるが

  •  P : \mathcal{Mnd}(\mathcal{C}) \to \mathcal{Mnd}({} ^ E \negthinspace / \mathcal{C})

を(たぶん)作れるので

  •  Q \circ P : \mathcal{Mnd}(\mathcal{C}) \to \mathcal{Mnd}(\mathcal{C})

error monad transformer。

参考文献

*1:comma category

*2:View-operation adjunction の dual