category-theory-presentation/categories/30_How/200_Monads/040_Natural_Transformation_Examples_4_4.md
2013-02-28 16:49:12 +01:00

751 B

Natural Transformation Examples (4/4)

mToList :: Maybe a -> [a]
mToList Nothing = []
mToList Just x  = [x]

toMaybe is a natural transformation. It is also a morphism from [] to Maybe in the Category of \(\Hask\) endofunctors.

natural transformation commutative diagram
relation between [] and Maybe
There is no isomorphism.
Hint: Bool lists longer than 1.