Browse Source

fixed an error

master
parent
commit
05ce91da2b
  1. 76
      categories.html
  2. BIN
      categories/img/mp/abstraction.png
  3. BIN
      categories/img/mp/associativecomposition.png
  4. BIN
      categories/img/mp/boxfunctor.png
  5. BIN
      categories/img/mp/cat-example1.png
  6. BIN
      categories/img/mp/cat-example2.png
  7. BIN
      categories/img/mp/cat-example3.png
  8. BIN
      categories/img/mp/cat-example4.png
  9. BIN
      categories/img/mp/cat-example5.png
  10. BIN
      categories/img/mp/cat-hask-endofunctor.png
  11. BIN
      categories/img/mp/commutative-diagram-assoc.png
  12. BIN
      categories/img/mp/commutative-diagram-id.png
  13. BIN
      categories/img/mp/composition.png
  14. BIN
      categories/img/mp/endofunctor.png
  15. BIN
      categories/img/mp/functor-morphism-color.png
  16. BIN
      categories/img/mp/functor-morphism.png
  17. BIN
      categories/img/mp/functor.png
  18. BIN
      categories/img/mp/graph-category.png
  19. BIN
      categories/img/mp/hask-endofunctor-morphisms.png
  20. BIN
      categories/img/mp/hask-endofunctor-objects.png
  21. BIN
      categories/img/mp/hask-endofunctor.png
  22. BIN
      categories/img/mp/hask.png
  23. BIN
      categories/img/mp/identity.png
  24. BIN
      categories/img/mp/list-maybe-endofunctor-morphism.png
  25. 4
      categories/img/mp/list-tree-endofunctor-morphism.mp
  26. BIN
      categories/img/mp/list-tree-endofunctor-morphism.png
  27. BIN
      categories/img/mp/maybe-list-endofunctor-morphsm.png
  28. BIN
      categories/img/mp/monoid.png
  29. BIN
      categories/img/mp/morphisms.png
  30. BIN
      categories/img/mp/nattrans-list-maybe.png
  31. 10
      categories/img/mp/nattrans-list-tree.mp
  32. BIN
      categories/img/mp/nattrans-list-tree.png
  33. BIN
      categories/img/mp/nattrans-maybe-list.png
  34. 14
      categories/img/mp/nattrans-tree-list.mp
  35. BIN
      categories/img/mp/nattrans-tree-list.png
  36. BIN
      categories/img/mp/natural-transformation.png
  37. BIN
      categories/img/mp/numbers.png
  38. BIN
      categories/img/mp/objects.png
  39. BIN
      categories/img/mp/pipe.png
  40. BIN
      categories/img/mp/preorder.png
  41. BIN
      categories/img/mp/set.png
  42. BIN
      categories/img/mp/strings.png
  43. 6
      categories/img/mp/tree-list-endofunctor-morphism.mp
  44. BIN
      categories/img/mp/tree-list-endofunctor-morphism.png
  45. 0
      deck2pdf.sh
  46. 8
      deck2png.js
  47. 58
      deck2png.js.back
  48. 4
      jquery-1.7.2.min.js.back
  49. 4
      modernizr.custom.js.back
  50. BIN
      output.pdf
  51. 8
      png2pdf.js
  52. 19
      png2pdf.js.back

76
categories.html

@ -69,8 +69,9 @@
<section class="slide">
<div style="text-align:center; position:absolute; top: 2em; font-size: .9em; width: 100%">
<h1 style="position: relative;">Category Theory <span class="and">&amp;</span> Programming</h1>
<author><em class="base01">by</em> Yann Esposito</author>
<div style="font-size:.5em">
<div><em class="base01">for</em> <a href="http://www.meetup.com/riviera-scala-clojure">Rivieria Scala Clojure</a> (Note this presentation uses Haskell)</div>
<author><em class="base01">by</em> <a href="http://yannesposito.com">Yann Esposito</a></author>
<div style="font-size:.8em">
<twitter>
<a href="http://twitter.com/yogsototh">@yogsototh</a>,
</twitter>
@ -80,7 +81,7 @@
</div>
<div class="base01" style="font-size: .5em; font-weight: 400; font-variant:italic">
<div class="button" style="margin: .5em auto;border: solid 2px; padding: 5px; width: 8em; border-radius: 1em; background:rgba(255,255,255,0.05);" onclick="javascript:gofullscreen();">ENTER FULLSCREEN</div>
HTML presentation: use arrows, space to navigate.
HTML presentation: use arrows, space, swipe to navigate.
</div>
</div>
</section>
@ -703,35 +704,33 @@ Haskell types is fractal:</p>
<p><img src="categories/img/mp/natural-transformation.png" alt="Natural transformation commutative diagram" class="right"/> <em>A natural transformation:</em> familly η ; \(η_X\in\hom{\D}\) for \(X\in\ob{\C}\) s.t.</p>
<p>ex: between Haskell functors; <code>F a -&gt; G a</code><br />Rearragement functions only.</p>
</section>
<section class="slide">
<h2 id="natural-transformation-examples-14">Natural Transformation Examples (1/4)</h2>
<pre><code class="haskell small">data Tree a = Empty | Node a [Tree a]
toTree :: [a] -> Tree a
toTree [] = Empty
toTree (x:xs) = Node x [toTree xs]</pre>
<pre><code class="haskell small">data List a = Nil | Cons a (List a)
toList :: [a] -> Tree a
toList [] = Nil
toList (x:xs) = Cons x (toList xs)</pre>
</code>
<p><code>toTree</code> is a natural transformation. It is also a morphism from <code>[]</code> to <code>Tree</code> in the Category of \(\Hask\) endofunctors.</p>
<p><code>toList</code> is a natural transformation. It is also a morphism from <code>[]</code> to <code>List</code> in the Category of \(\Hask\) endofunctors.</p>
<img style="float:left;width:30%" src="categories/img/mp/nattrans-list-tree.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:60%">
<img style="width:40%" src="categories/img/mp/list-tree-endofunctor-morphism.png" alt="natural transformation commutative diagram"/>
</figure>
</section>
<section class="slide">
<h2 id="natural-transformation-examples-24">Natural Transformation Examples (2/4)</h2>
<pre><code class="haskell small">data Tree a = Empty | Node a [Tree a]
toList :: Tree a -> [a]
toList Empty = []
toList (Node x l) = [x] ++ concat (map toList l)</pre>
<pre><code class="haskell small">data List a = Nil | Cons a (List a)
toHList :: List a -> [a]
toHList Nil = []
toHList (Cons x xs) = x:toHList xs</pre>
</code>
<p><code>toList</code> is a natural transformation. It is also a morphism from <code>Tree</code> to <code>[]</code> in the Category of \(\Hask\) endofunctors.</p>
<p><code>toHList</code> is a natural transformation. It is also a morphism from <code>List</code> to <code>[]</code> in the Category of \(\Hask\) endofunctors.</p>
<img style="float:left;width:30%" src="categories/img/mp/nattrans-tree-list.png" alt="natural transformation commutative diagram"/>
<figure style="float:right;width:60%">
<img style="width:40%" 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> <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>
<img style="width:40%" src="categories/img/mp/tree-list-endofunctor-morphism.png" alt="natural transformation commutative diagram"/> <figcaption><code>toList . toHList = id</code> <span class="and">&amp;</span> <code>toHList . toList = id</code> <span style="visibility:hidden"><span class="and">&amp;</span></span><br/> therefore <code>[]</code> <span class="and">&amp;</span> <code>List</code> are <span class="orange">isomorph</span>. </figcaption>
</figure>
</section>
<section class="slide">
<h2 id="natural-transformation-examples-34">Natural Transformation Examples (3/4)</h2>
@ -1072,10 +1071,49 @@ depth = cata phi where
});
</script>
<!-- Y theme -->
<script src="js/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="js/highlight/highlight.pack.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<script>
// --- Google analytics ---
function analytics() {
// add an event to all link for google analytics
$('a').click(function () {
// tell analytics to save event
try {
var identifier=$(this).attr('id') ;
var href=$(this).attr('href')
var label="";
if ( typeof( identifier ) != 'undefined' ) {
label=label+'[id]:'+identifier
category='JSLink'
}
if ( typeof( href ) != 'undefined' ) {
label=label+' [href]:'+href
if ( href[0] == '#' ) {
category='Anchor';
} else {
category='Link';
}
}
_gaq.push(['_trackEvent', category, 'clicked', label]);
// console.log('[tracked]: ' + category + ' ; clicked ; ' + label );
}
catch (err) {
console.log(err);
}
// pause to allow google script to run
var date = new Date();
var curDate = null;
do {
curDate = new Date();
} while(curDate-date < 300);
});
}
$(document).ready(function(){ analytics(); });
</script>
</body>
</html>

BIN
categories/img/mp/abstraction.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 102 KiB

BIN
categories/img/mp/associativecomposition.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 780 KiB

After

Width:  |  Height:  |  Size: 774 KiB

BIN
categories/img/mp/boxfunctor.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 KiB

After

Width:  |  Height:  |  Size: 491 KiB

BIN
categories/img/mp/cat-example1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 85 KiB

BIN
categories/img/mp/cat-example2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 80 KiB

BIN
categories/img/mp/cat-example3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 205 KiB

BIN
categories/img/mp/cat-example4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 KiB

After

Width:  |  Height:  |  Size: 372 KiB

BIN
categories/img/mp/cat-example5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 292 KiB

BIN
categories/img/mp/cat-hask-endofunctor.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 KiB

After

Width:  |  Height:  |  Size: 863 KiB

BIN
categories/img/mp/commutative-diagram-assoc.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 210 KiB

BIN
categories/img/mp/commutative-diagram-id.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 176 KiB

BIN
categories/img/mp/composition.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 331 KiB

BIN
categories/img/mp/endofunctor.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 KiB

After

Width:  |  Height:  |  Size: 914 KiB

BIN
categories/img/mp/functor-morphism-color.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 KiB

After

Width:  |  Height:  |  Size: 813 KiB

BIN
categories/img/mp/functor-morphism.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
categories/img/mp/functor.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 968 KiB

After

Width:  |  Height:  |  Size: 962 KiB

BIN
categories/img/mp/graph-category.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

After

Width:  |  Height:  |  Size: 325 KiB

BIN
categories/img/mp/hask-endofunctor-morphisms.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

BIN
categories/img/mp/hask-endofunctor-objects.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

BIN
categories/img/mp/hask-endofunctor.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

BIN
categories/img/mp/hask.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 KiB

After

Width:  |  Height:  |  Size: 900 KiB

BIN
categories/img/mp/identity.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 253 KiB

BIN
categories/img/mp/list-maybe-endofunctor-morphism.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 276 KiB

4
categories/img/mp/list-tree-endofunctor-morphism.mp

@ -3,5 +3,5 @@ resize(.8cm);
list=origin;
tree=list shifted (gu,0);
drawState(list,"\mathtt{[]}");
drawState(tree,"\mathtt{Tree}");
drawEdgeAngle(list,tree,"\mathtt{toTree}",30);
drawState(tree,"\mathtt{List}");
drawEdgeAngle(list,tree,"\mathtt{toList}",30);

BIN
categories/img/mp/list-tree-endofunctor-morphism.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 254 KiB

BIN
categories/img/mp/maybe-list-endofunctor-morphsm.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 KiB

After

Width:  |  Height:  |  Size: 386 KiB

BIN
categories/img/mp/monoid.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 KiB

After

Width:  |  Height:  |  Size: 377 KiB

BIN
categories/img/mp/morphisms.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
categories/img/mp/nattrans-list-maybe.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 328 KiB

10
categories/img/mp/nattrans-list-tree.mp

@ -6,16 +6,16 @@ path ac,ab;
label(btex $\mathtt{[a]}$ etex,z0);
label(btex $\mathtt{[b]}$ etex,z1);
label(btex $\mathtt{Tree\ a}$ etex,z2 shifted (-u,0));
label(btex $\mathtt{Tree\ b}$ etex,z3 shifted (u,0));
label(btex $\mathtt{List\ a}$ etex,z2 shifted (-u,0));
label(btex $\mathtt{List\ b}$ etex,z3 shifted (u,0));
drawEdge(z0,z1,"\mathtt{fmap_{[]}\ f}");
drawEdge(z2,z3,"\mathtt{fmap_{Tree}\ f}");
drawEdge(z2,z3,"\mathtt{fmap_{List}\ f}");
ab:=edge(z0,z2);
drawarrow ab;
label.lft(btex $\mathtt{toTree}$ etex,midpoint(ab));
label.lft(btex $\mathtt{toList}$ etex,midpoint(ab));
ac:=edge(z1,z3);
drawarrow ac;
label.rt(btex $\mathtt{toTree}$ etex,midpoint(ac));
label.rt(btex $\mathtt{toList}$ etex,midpoint(ac));

BIN
categories/img/mp/nattrans-list-tree.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 297 KiB

BIN
categories/img/mp/nattrans-maybe-list.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 330 KiB

14
categories/img/mp/nattrans-tree-list.mp

@ -6,18 +6,18 @@ path ac,ab;
label(btex $\mathtt{[a]}$ etex,z0);
label(btex $\mathtt{[b]}$ etex,z1);
label(btex $\mathtt{Tree\ a}$ etex,z2 shifted (-u,0));
label(btex $\mathtt{Tree\ b}$ etex,z3 shifted (u,0));
label(btex $\mathtt{List\ a}$ etex,z2 shifted (-u,0));
label(btex $\mathtt{List\ b}$ etex,z3 shifted (u,0));
drawEdge(z0,z1,"\mathtt{fmap_{[]}\ f}");
drawEdge(z2,z3,"\mathtt{fmap_{Tree}\ f}");
drawEdge(z2,z3,"\mathtt{fmap_{List}\ f}");
ab:=edge(z0,z2);
drawarrow ab;
label.lft(btex $\mathtt{toTree}$ etex,midpoint(ab));
label.lft(btex $\mathtt{toList}$ etex,midpoint(ab));
ac:=edge(z1,z3);
drawarrow ac;
label.rt(btex $\mathtt{toTree}$ etex,midpoint(ac));
label.rt(btex $\mathtt{toList}$ etex,midpoint(ac));
drawoptions(withcolor yellow);
path abb,acb;
@ -25,5 +25,5 @@ abb:=edge(z2 shifted (.2u,0),z0 shifted (.2u,0));
acb:=edge(z3 shifted (-.2u,0),z1 shifted (-.2u,0));
drawarrow abb;
drawarrow acb;
label.rt(btex $\mathtt{toList}$ etex,midpoint(abb));
label.lft(btex $\mathtt{toList}$ etex,midpoint(acb));
label.rt(btex $\mathtt{toHList}$ etex,midpoint(abb));
label.lft(btex $\mathtt{toHList}$ etex,midpoint(acb));

BIN
categories/img/mp/nattrans-tree-list.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

After

Width:  |  Height:  |  Size: 344 KiB

BIN
categories/img/mp/natural-transformation.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

After

Width:  |  Height:  |  Size: 231 KiB

BIN
categories/img/mp/numbers.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 KiB

After

Width:  |  Height:  |  Size: 372 KiB

BIN
categories/img/mp/objects.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 KiB

After

Width:  |  Height:  |  Size: 339 KiB

BIN
categories/img/mp/pipe.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
categories/img/mp/preorder.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 KiB

After

Width:  |  Height:  |  Size: 673 KiB

BIN
categories/img/mp/set.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 KiB

After

Width:  |  Height:  |  Size: 383 KiB

BIN
categories/img/mp/strings.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 KiB

After

Width:  |  Height:  |  Size: 374 KiB

6
categories/img/mp/tree-list-endofunctor-morphism.mp

@ -3,7 +3,7 @@ resize(.8cm);
list=origin;
tree=list shifted (gu,0);
drawState(list,"\mathtt{[]}");
drawState(tree,"\mathtt{Tree}");
drawEdgeAngle(list,tree,"\mathtt{toTree}",30);
drawState(tree,"\mathtt{List}");
drawEdgeAngle(list,tree,"\mathtt{toList}",30);
drawoptions(withcolor yellow);
drawEdgeAngle(tree,list,"\mathtt{toList}",30);
drawEdgeAngle(tree,list,"\mathtt{toHList}",30);

BIN
categories/img/mp/tree-list-endofunctor-morphism.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

After

Width:  |  Height:  |  Size: 357 KiB

0
deck2pdf.sh

8
deck2png.js

@ -15,8 +15,8 @@ page.onLoadFinished = function(status) {
}
page.viewportSize = {
width: 960,
height: 522
width: 1920,
height: 1044
};
slideCount = page.evaluate(function() {
@ -24,8 +24,8 @@ page.onLoadFinished = function(status) {
$('html').removeClass('csstransitions cssreflections');
$('html, body').css({
'width': 960,
'height': 522,
'width': 1920,
'height': 1044,
'overflow': 'hidden'
});
$.deck('.slide');

58
deck2png.js.back

@ -0,0 +1,58 @@
var webpage = require('webpage'),
page = webpage.create(),
system = require('system'),
url = system.args[1] || 'index.html',
fs = require('fs'),
imageSources = [],
imageTags;
page.onLoadFinished = function(status) {
var slideCount;
if (status !== 'success') {
console.log('Target file not found.');
phantom.exit();
}
page.viewportSize = {
width: 960,
height: 522
};
slideCount = page.evaluate(function() {
var $ = window.jQuery;
$('html').removeClass('csstransitions cssreflections');
$('html, body').css({
'width': 960,
'height': 522,
'overflow': 'hidden'
});
$.deck('.slide');
return $.deck('getSlides').length;
});
fs.makeDirectory('temp-slides');
for (var i = 0; i < slideCount; i++) {
var src = 'temp-slides/output-' + i + '.png';
imageSources.push(src);
console.log('Rendering slide #' + i);
page.render(src);
page.evaluate(function() {
var $ = window.jQuery;
$.deck('next');
});
}
imageTags = imageSources.map(function(src) {
return '<img src="' + src + '" style="dispay:block;" width="100%">';
});
var output = imageTags.join('') + '<style>*{margin:0;padding:0}</style>';
fs.write('temp-output.html', output, 'w');
phantom.exit();
};
page.open(url);

4
jquery-1.7.2.min.js.back

File diff suppressed because one or more lines are too long

4
modernizr.custom.js.back

File diff suppressed because one or more lines are too long

BIN
output.pdf

Binary file not shown.

8
png2pdf.js

@ -4,12 +4,12 @@ var webpage = require('webpage'),
page.open('temp-output.html', function(status) {
page.viewportSize = {
width: 960,
height: 522
width: 1920,
height: 1044
};
page.paperSize = {
width: 960,
height: 522
width: 1920,
height: 1044
};
page.render('output.pdf');

19
png2pdf.js.back

@ -0,0 +1,19 @@
var webpage = require('webpage'),
page = webpage.create(),
fs = require('fs');
page.open('temp-output.html', function(status) {
page.viewportSize = {
width: 960,
height: 522
};
page.paperSize = {
width: 960,
height: 522
};
page.render('output.pdf');
fs.removeTree('temp-slides');
fs.remove('temp-output.html');
phantom.exit();
});
Loading…
Cancel
Save