388 B
388 B
Example: List
[] :: * -> *
an Endofunctor- \(⊙:M×M→M\) a nat. trans. (
join :: M (M a) -> M a
) - \(η:I→M\) a nat. trans.
-- In Haskell ⊙ is "join" in "Control.Monad"
join :: [[a]] -> [a]
join = concat
-- In Haskell the "return" function (unfortunate name)
η :: a -> [a]
η x = [x]