463 B
463 B
We reinvented Monads!
A monad is a triplet (M,⊙,η)
where
- \(M\) an Endofunctor (to type
a
associateM a
) - \(⊙:M×M→M\) a nat. trans. (i.e.
⊙::M (M a) → M a
;join
) - \(η:I→M\) a nat. trans. (\(I\) identity functor ;
η::a → M a
)
Satisfying
- \(M ⊙ (M ⊙ M) = (M ⊙ M) ⊙ M\)
- \(η ⊙ M = M = M ⊙ η\)