Introduction
Category
Examples of Categories
More Examples
Extra Material
Functor
Examples of Functors
More Examples
Natural Transformation
Examples
More Examples
Monad
Monad Examples
More Examples Exception Monad
State Machine Monad
State Machine (cont'd)
Monads in Programming References
Haskell IO |
A monad in category C is an endofunctor F: C → C with two natural transformations: u: 1 → F and m: F ∘ F → F.
Let's denote F(u): F -> F ∘ F the transformation that results in applying F to u, and F(m) : (F ∘ F) ∘ F → F ∘ F.
Having these, now we can write down the following two monad axioms:
- F(u) ∘ m is identity F → F
:
- F(m) ∘ m is the same as m ∘ m:
|
|