some fixes

This commit is contained in:
Yann Esposito 2012-12-07 12:17:02 +01:00
parent dceac9e1e4
commit 6e08bf59be
14 changed files with 32 additions and 83 deletions

View file

@ -630,7 +630,7 @@ Haskell types is fractal:</p>
</section>
<section class="slide">
<h2 id="also-functor-inside-hask">Also Functor inside \(\Hask\)</h2>
<p><code>length</code> can be seen as a Functor from the category <code>[a]</code> to <code>Int</code>. More precisely:</p>
<p><code>length</code> can be seen as a Functor from the category <code>[a]</code> to the cateogry <code>Int</code>:</p>
<ul class="left">
<li>\(\ob{\mathtt{[a]}}=\{∙\}\)</li>
<li>\(\hom{\mathtt{[a]}}=\mathtt{[a]}\)</li>
@ -656,14 +656,13 @@ Haskell types is fractal:</p>
<li>\(\hom{\E_\C}\): natural transformations
<ul>
<li>η familly \(η_X\in\hom{\C}\) for \(X\in\ob{\C}\) s.t.</li>
<li>for Haskell functors: <code>F a -&gt; G a</code> are the natural transformations.<br />List to Trees, Tree to List, Tree to Maybe...<br />Rearragement functions only.</li>
<li>for Haskell functors: <code>F a -&gt; G a</code>.<br />Rearragement functions only.</li>
</ul></li>
</ul>
</section>
<section class="slide">
<h2 id="natural-transformation-examples">Natural Transformation Examples</h2>
<h2 id="natural-transformation-examples-13">Natural Transformation Examples (1/3)</h2>
<pre><code class="haskell">data Tree a = Empty | Node a [Tree a]
deriving (Show)
toTree :: [a] -> Tree a
toTree [] = Empty
toTree (x:xs) = Node x [toTree xs]</pre>
@ -677,9 +676,8 @@ toTree (x:xs) = Node x [toTree xs]</pre>
</section>
<section class="slide">
<h2 id="natural-transformation-examples">Natural Transformation Examples</h2>
<h2 id="natural-transformation-examples-23">Natural Transformation Examples (2/3)</h2>
<pre><code class="haskell">data Tree a = Empty | Node a [Tree a]
deriving (Show)
toList :: Tree a -> [a]
toList Empty = []
toList (Node x l) = [x] ++ concat (map toList l)</pre>
@ -687,13 +685,13 @@ toList (Node x l) = [x] ++ concat (map toList l)</pre>
<p><code>toList</code> is a natural transformation. It is also a morphism from <code>Tree</code> to <code>[]</code> in the Category of \(\) endofunctors.</p>
<img style="float:left;width:50%" src="categories/img/mp/nattrans-tree-list.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:40%">
<img src="categories/img/mp/tree-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/> <figcaption><code>toList.toTree=id</code> <span class="and">&amp;</span> <code>toTree.toList=id</code>.<br/> Therefore <code>[]</code> <span class="and">&amp;</span> <code>Tree</code> are <span class="yellow">isomorph</span>. </figcaption>
<img src="categories/img/mp/tree-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/> <figcaption><code>toList . toTree = id</code> <span class="and">&amp;</span><br/> <code>toTree . toList = id</code> <span style="visibility:hidden"><span class="and">&amp;</span></span><br/> therefore <code>[]</code> <span class="and">&amp;</span> <code>Tree</code> are <span class="yellow">isomorph</span>. </figcaption>
</figure>
</section>
<section class="slide">
<h2 id="another-nat.-trans.-example">Another Nat. Trans. Example</h2>
<h2 id="natural-transformation-examples-33">Natural Transformation Examples (3/3)</h2>
<pre><code class="haskell">
toMaybe :: [a] -> Maybe a ; mToList :: Maybe a -> [a]
toMaybe [] = Nothing ; mToList Nothing = []
@ -707,21 +705,6 @@ toMaybe (x:xs) = Just x ; mToList Just x = [x]
</figure>
</section>
<section class="slide">
<h2 id="another-nat.-trans.-example">Another Nat. Trans. Example</h2>
<pre><code class="haskell">
toMaybe :: [a] -> Maybe a
toMaybe [] = Nothing
toMaybe (x:xs) = Just x</pre>
</code>
<p><code>toMaybe</code> is a natural transformation. It is also a morphism from <code>[]</code> to <code>Maybe</code> in the Category of \(\) endofunctors.</p>
<img style="float:left;width:50%" src="categories/img/mp/nattrans-maybe-list.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:40%">
<img src="categories/img/mp/maybe-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/> <figcaption>There is no isomorphism.<br/> Hint: List with more than one element. </figcaption>
</figure>
</section>
<section class="slide">
<h2 id="monads">Monads</h2>

View file

@ -1,5 +1,5 @@
<h2 id="also-functor-inside-hask">Also Functor inside \(\Hask\)</h2>
<p><code>length</code> can be seen as a Functor from the category <code>[a]</code> to <code>Int</code>. More precisely:</p>
<p><code>length</code> can be seen as a Functor from the category <code>[a]</code> to the cateogry <code>Int</code>:</p>
<ul class="left">
<li>\(\ob{\mathtt{[a]}}=\{∙\}\)</li>
<li>\(\hom{\mathtt{[a]}}=\mathtt{[a]}\)</li>

View file

@ -6,6 +6,6 @@
<li>\(\hom{\E_\C}\): natural transformations
<ul>
<li>η familly \(η_X\in\hom{\C}\) for \(X\in\ob{\C}\) s.t.</li>
<li>for Haskell functors: <code>F a -&gt; G a</code> are the natural transformations.<br />List to Trees, Tree to List, Tree to Maybe...<br />Rearragement functions only.</li>
<li>for Haskell functors: <code>F a -&gt; G a</code>.<br />Rearragement functions only.</li>
</ul></li>
</ul>

View file

@ -11,6 +11,5 @@ of endofunctors of \\(\\C\\).
- \\(\\ob{\\E\_\\C}\\): endofunctors of \\(\\C\\) ; \\(F:\\C→\\C\\)
- \\(\\hom{\\E\_\\C}\\): natural transformations
- η familly \\(η\_X\\in\\hom{\\C}\\) for \\(X\\in\\ob{\\C}\\) s.t.
- for Haskell functors: `F a -> G a` are the natural transformations.
List to Trees, Tree to List, Tree to Maybe...
- for Haskell functors: `F a -> G a`.
Rearragement functions only.

View file

@ -1,6 +1,5 @@
<h2 id="natural-transformation-examples">Natural Transformation Examples</h2>
<h2 id="natural-transformation-examples-13">Natural Transformation Examples (1/3)</h2>
<pre><code class="haskell">data Tree a = Empty | Node a [Tree a]
deriving (Show)
toTree :: [a] -> Tree a
toTree [] = Empty
toTree (x:xs) = Node x [toTree xs]</pre>

View file

@ -1,8 +1,7 @@
Natural Transformation Examples
-------------------------------
Natural Transformation Examples (1/3)
------------------------------------
<pre><code class="haskell">data Tree a = Empty | Node a [Tree a]
deriving (Show)
toTree :: [a] -> Tree a
toTree [] = Empty
toTree (x:xs) = Node x [toTree xs]</pre></code>

View file

@ -1,6 +1,5 @@
<h2 id="natural-transformation-examples">Natural Transformation Examples</h2>
<h2 id="natural-transformation-examples-23">Natural Transformation Examples (2/3)</h2>
<pre><code class="haskell">data Tree a = Empty | Node a [Tree a]
deriving (Show)
toList :: Tree a -> [a]
toList Empty = []
toList (Node x l) = [x] ++ concat (map toList l)</pre>
@ -8,7 +7,7 @@ toList (Node x l) = [x] ++ concat (map toList l)</pre>
<p><code>toList</code> is a natural transformation. It is also a morphism from <code>Tree</code> to <code>[]</code> in the Category of \(\) endofunctors.</p>
<img style="float:left;width:50%" src="categories/img/mp/nattrans-tree-list.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:40%">
<img src="categories/img/mp/tree-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/> <figcaption><code>toList.toTree=id</code> &amp; <code>toTree.toList=id</code>.<br/> Therefore <code>[]</code> &amp; <code>Tree</code> are <span class="yellow">isomorph</span>. </figcaption>
<img src="categories/img/mp/tree-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/> <figcaption><code>toList . toTree = id</code> &amp;<br/> <code>toTree . toList = id</code> <span style="visibility:hidden">&amp;</span><br/> therefore <code>[]</code> &amp; <code>Tree</code> are <span class="yellow">isomorph</span>. </figcaption>
</figure>

View file

@ -1,8 +1,7 @@
Natural Transformation Examples
-------------------------------
Natural Transformation Examples (2/3)
------------------------------------
<pre><code class="haskell">data Tree a = Empty | Node a [Tree a]
deriving (Show)
toList :: Tree a -> [a]
toList Empty = []
toList (Node x l) = [x] ++ concat (map toList l)</pre></code>
@ -14,7 +13,7 @@ It is also a morphism from `Tree` to `[]` in the Category of \\(\Hask\\) endofun
<img style="float:left;width:50%" src="categories/img/mp/nattrans-tree-list.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:40%">
<img src="categories/img/mp/tree-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/>
<figcaption><code>toList.toTree=id</code> &amp; <code>toTree.toList=id</code>.<br/>
Therefore <code>[]</code> &amp; <code>Tree</code> are <span class="yellow">isomorph</span>.
<figcaption><code>toList . toTree = id</code> &amp;<br/> <code>toTree . toList = id</code> <span style="visibility:hidden">&amp;</span><br/>
therefore <code>[]</code> &amp; <code>Tree</code> are <span class="yellow">isomorph</span>.
</figcaption>
</figure>

View file

@ -1,4 +1,4 @@
<h2 id="another-nat.-trans.-example">Another Nat. Trans. Example</h2>
<h2 id="natural-transformation-examples-33">Natural Transformation Examples (3/3)</h2>
<pre><code class="haskell">
toMaybe :: [a] -> Maybe a ; mToList :: Maybe a -> [a]
toMaybe [] = Nothing ; mToList Nothing = []

View file

@ -1,5 +1,5 @@
Another Nat. Trans. Example
---------------------------
Natural Transformation Examples (3/3)
-------------------------------------
<pre><code class="haskell">
toMaybe :: [a] -> Maybe a ; mToList :: Maybe a -> [a]

View file

@ -1,13 +0,0 @@
<h2 id="another-nat.-trans.-example">Another Nat. Trans. Example</h2>
<pre><code class="haskell">
toMaybe :: [a] -> Maybe a
toMaybe [] = Nothing
toMaybe (x:xs) = Just x</pre>
</code>
<p><code>toMaybe</code> is a natural transformation. It is also a morphism from <code>[]</code> to <code>Maybe</code> in the Category of \(\) endofunctors.</p>
<img style="float:left;width:50%" src="categories/img/mp/nattrans-maybe-list.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:40%">
<img src="categories/img/mp/maybe-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/> <figcaption>There is no isomorphism.<br/> Hint: List with more than one element. </figcaption>
</figure>

View file

@ -1,19 +0,0 @@
Another Nat. Trans. Example
---------------------------
<pre><code class="haskell">
toMaybe :: [a] -> Maybe a
toMaybe [] = Nothing
toMaybe (x:xs) = Just x</pre></code>
`toMaybe` is a natural transformation.
It is also a morphism from `[]` to `Maybe` in the Category of \\(\Hask\\) endofunctors.
<img style="float:left;width:50%" src="categories/img/mp/nattrans-maybe-list.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:40%">
<img src="categories/img/mp/maybe-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/>
<figcaption>There is no isomorphism.<br/>
Hint: List with more than one element.
</figcaption>
</figure>

View file

@ -838,14 +838,16 @@ body.deck-container {
background-color: #073642; }
.deck-container table tr:nth-child(even) {
background-color: #002b36; }
.deck-container p pre code, .deck-container ul li pre code, .deck-container ol li pre code {
background: none;
border: none;
padding: 0; }
.deck-container p code, .deck-container ul li code, .deck-container ol li code {
background: #053440;
border: solid 1px #586e75;
padding: 2px; }
.deck-container p, .deck-container ul li, .deck-container ol li {
line-height: 1.5em; }
.deck-container p pre code, .deck-container ul li pre code, .deck-container ol li pre code {
background: none;
border: none;
padding: 0; }
.deck-container p code, .deck-container ul li code, .deck-container ol li code {
background: #053440;
border: solid 1px #586e75;
padding: 2px; }
.deck-container ul.sameline {
list-style: none; }
.deck-container ul.sameline li {

View file

@ -1075,6 +1075,7 @@ body.deck-container
background-color: $mainBackgroundColor
p, ul li, ol li
line-height: 1.5em
pre code
background: none
border: none