PS

Element-wise law

Element-free law

Monad morphism:

  •  \mathtt{morph} : (m, \mathtt{return}, \mathtt{join}) \rightarrow  (m', \mathtt{return'}, \mathtt{join'})

の要件は、

  1.  \mathtt{morph} : m \rightarrow m' *1
  2.  \mathtt{morph} \circ \mathtt{join} = \mathtt{join'} \circ (\mathtt{morph} \star \mathtt{morph}) *2
  3.  \mathtt{morph} \circ \mathtt{return} = \mathtt{return'}

であった。

Element-wise law

一方、Control.Monad.Morphでは、

 morph . (f >=> g) = morph . f >=> morph . g 
 morph . return = return

となっていて、あれ?と思ってしまったが、 これはElement - PSの命題:

  •  h = h' \Leftrightarrow ({} ^ \forall z, h \circ z = h' \circ z)

および、これを一般化した命題:

を利用したもの(と思う)。

参考文献

*1:natural transformation

*2: \star はGodement product

*3:証明は、 z にidentity morphismをとればいい