category-theory-presentation/categories/30_How/200_Monads/140_Example_List.md

15 lines
388 B
Markdown
Raw Normal View History

Example: List
-------------
- `[] :: * -> *` an <span class="yellow">Endofunctor</span>
- \\(⊙:M×M→M\\) a nat. trans. (`join :: M (M a) -> M a`)
- \\(η:I→M\\) a nat. trans.
<pre class="haskell"><code>-- In Haskell ⊙ is "join" in "Control.Monad"
join :: [[a]] -> [a]
join = concat
-- In Haskell the "return" function (unfortunate name)
η :: a -> [a]
η x = [x]</code></pre>