751 B
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.