category-theory-presentation/categories/30_How/200_Monads/150_Example_List_law_verification.html
2013-02-28 16:49:12 +01:00

12 lines
493 B
HTML

<h2 id="example-list-law-verification">Example: List (law verification)</h2>
<p>Example: <code>List</code> is a functor (<code>join</code> is ⊙)</p>
<ul>
<li>\(M ⊙ (M ⊙ M) = (M ⊙ M) ⊙ M\)</li>
<li>\(η ⊙ M = M = M ⊙ η\)</li>
</ul>
<pre class="nohighlight small"><code>join [ join [[x,y,...,z]] ] = join [[x,y,...,z]]
= join (join [[[x,y,...,z]]])
join (η [x]) = [x] = join [η x]</code></pre>
<p>Therefore <code>([],join,η)</code> is a monad.</p>