From ac8ce041d7ecc6a183ba9db03b6557a740a2736a Mon Sep 17 00:00:00 2001
From: Yann Esposito
Date: Tue, 20 Nov 2012 17:01:31 +0100
Subject: [PATCH] update
---
categories.html | 50 +++++++++++++++++--
categories/30_How/110_Functor_as_boxes.html | 6 +++
.../30_How/120_Also_Functor_inside_Hask.md | 14 ------
...l => 120_Non_Haskell_Hask_s_Functors.html} | 2 +-
....md => 120_Non_Haskell_Hask_s_Functors.md} | 0
...html => 130_Also_Functor_inside_Hask.html} | 10 ++--
categories/30_How/131.html | 9 ++++
categories/30_How/131.md | 12 +++++
categories/30_How/140_Monads.html | 7 +++
categories/30_How/140_Monads.md | 8 +++
categories/head.html | 2 +
11 files changed, 98 insertions(+), 22 deletions(-)
create mode 100644 categories/30_How/110_Functor_as_boxes.html
delete mode 100644 categories/30_How/120_Also_Functor_inside_Hask.md
rename categories/30_How/{110_Non_Haskell_Hask_s_Functors.html => 120_Non_Haskell_Hask_s_Functors.html} (89%)
rename categories/30_How/{110_Non_Haskell_Hask_s_Functors.md => 120_Non_Haskell_Hask_s_Functors.md} (100%)
rename categories/30_How/{120_Also_Functor_inside_Hask.html => 130_Also_Functor_inside_Hask.html} (65%)
create mode 100644 categories/30_How/131.html
create mode 100644 categories/30_How/131.md
create mode 100644 categories/30_How/140_Monads.html
create mode 100644 categories/30_How/140_Monads.md
diff --git a/categories.html b/categories.html
index 3b85e4a..ee7ee02 100644
--- a/categories.html
+++ b/categories.html
@@ -34,6 +34,7 @@
\(\newcommand{\F}{\mathbf{F}}\)
+\(\newcommand{\E}{\mathbf{E}}\)
\(\newcommand{\C}{\mathcal{C}}\)
\(\newcommand{\D}{\mathcal{D}}\)
\(\newcommand{\id}{\mathrm{id}}\)
@@ -47,6 +48,7 @@
\(\newcommand{\ML}{\mathbf{ML}}\)
\(\newcommand{\Hask}{\mathbf{Hask}}\)
\(\newcommand{\Cat}{\mathbf{Cat}}\)
+\(\newcommand{\fmap}{\mathtt{fmap}}\)
@@ -688,6 +690,22 @@ Haskell types is fractal:
+Functor as boxes
+
+Haskell functor can be seen as boxes containing all Haskell types and functions.
+Haskell types is fractal:
+
+
+
+
+Functor as boxes
+
+Haskell functor can be seen as boxes containing all Haskell types and functions.
+Haskell types is fractal:
+
+
+
+
"Non Haskell" Hask's Functors
A simple basic example is the \(id_\Hask\) functor. It simply cannot be expressed as a couple (F
,fmap
) where
Also Functor inside \(\Hask\)
length
can be seen as a Functor from the category [a]
to Int
. More precisely:
-
+
- \(\ob{\mathtt{[a]}}=\{∙\}\)
- \(\hom{\mathtt{[a]}}=\mathtt{[a]}\)
- \(∘=\mathtt{(++)}\)
-&
-
+⇒
+
- \(\ob{\mathtt{Int}}=\{∙\}\)
- \(\hom{\mathtt{Int}}=\mathtt{Int}\)
- \(∘=\mathtt{(+)}\)
+
+- id:
length [] = 0
+ - comp:
length (l ++ l') = (length l) + (length l')
+
+
+
+Category of Endofunctors
+All endofunctors of \(\C\) form the category \(\E_\C\) of endofunctors of \(\C\).
+
+- \(\ob{\E_\C}\): endofunctors of \(\C\) ; \(F:\C→\C\)
+- \(\hom{\E_\C}\): natural transformations ; \(η:F→G\) s.t.
+
+- η function \( \ob{\C} → \hom{\C}, f:X→Y, η(Y)∘F(f)=G(f)∘η(X) \)
+
+
+
+
+Monads
+
+A Monad is just a monoid in the category of endofunctors, what's the problem?
+
+
+All told, a monad in X is just a monoid in the category of endofunctors of X, with product × replaced by composition of endofunctors and unit set by the identity endofunctor.
+
diff --git a/categories/30_How/110_Functor_as_boxes.html b/categories/30_How/110_Functor_as_boxes.html
new file mode 100644
index 0000000..7e6fc8b
--- /dev/null
+++ b/categories/30_How/110_Functor_as_boxes.html
@@ -0,0 +1,6 @@
+Functor as boxes
+
+Haskell functor can be seen as boxes containing all Haskell types and functions.
+Haskell types is fractal:
+
+
diff --git a/categories/30_How/120_Also_Functor_inside_Hask.md b/categories/30_How/120_Also_Functor_inside_Hask.md
deleted file mode 100644
index b9cac62..0000000
--- a/categories/30_How/120_Also_Functor_inside_Hask.md
+++ /dev/null
@@ -1,14 +0,0 @@
-## Also Functor inside \\(\\Hask\\)
-
-`length` can be seen as a Functor from the category `[a]` to `Int`.
-More precisely:
-
-- \\(\\ob{\\mathtt{[a]}}=\\{∙\\}\\)
-- \\(\\hom{\\mathtt{[a]}}=\\mathtt{[a]}\\)
-- \\(∘=\\mathtt{(++)}\\)
-
-&
-
-- \\(\\ob{\\mathtt{Int}}=\\{∙\\}\\)
-- \\(\\hom{\\mathtt{Int}}=\\mathtt{Int}\\)
-- \\(∘=\\mathtt{(+)}\\)
diff --git a/categories/30_How/110_Non_Haskell_Hask_s_Functors.html b/categories/30_How/120_Non_Haskell_Hask_s_Functors.html
similarity index 89%
rename from categories/30_How/110_Non_Haskell_Hask_s_Functors.html
rename to categories/30_How/120_Non_Haskell_Hask_s_Functors.html
index 11f8be1..ba94518 100644
--- a/categories/30_How/110_Non_Haskell_Hask_s_Functors.html
+++ b/categories/30_How/120_Non_Haskell_Hask_s_Functors.html
@@ -7,5 +7,5 @@
Also other degenerated examples:
- F(
T
)=Int
-- F(
f
)=\x->0
+- F(
f
)=\_->0
diff --git a/categories/30_How/110_Non_Haskell_Hask_s_Functors.md b/categories/30_How/120_Non_Haskell_Hask_s_Functors.md
similarity index 100%
rename from categories/30_How/110_Non_Haskell_Hask_s_Functors.md
rename to categories/30_How/120_Non_Haskell_Hask_s_Functors.md
diff --git a/categories/30_How/120_Also_Functor_inside_Hask.html b/categories/30_How/130_Also_Functor_inside_Hask.html
similarity index 65%
rename from categories/30_How/120_Also_Functor_inside_Hask.html
rename to categories/30_How/130_Also_Functor_inside_Hask.html
index d1c0ff1..e0ecb2f 100644
--- a/categories/30_How/120_Also_Functor_inside_Hask.html
+++ b/categories/30_How/130_Also_Functor_inside_Hask.html
@@ -1,13 +1,17 @@
Also Functor inside \(\Hask\)
length
can be seen as a Functor from the category [a]
to Int
. More precisely:
-
+
- \(\ob{\mathtt{[a]}}=\{∙\}\)
- \(\hom{\mathtt{[a]}}=\mathtt{[a]}\)
- \(∘=\mathtt{(++)}\)
-&
-
+⇒
+
- \(\ob{\mathtt{Int}}=\{∙\}\)
- \(\hom{\mathtt{Int}}=\mathtt{Int}\)
- \(∘=\mathtt{(+)}\)
+
+- id:
length [] = 0
+ - comp:
length (l ++ l') = (length l) + (length l')
+
diff --git a/categories/30_How/131.html b/categories/30_How/131.html
new file mode 100644
index 0000000..4508226
--- /dev/null
+++ b/categories/30_How/131.html
@@ -0,0 +1,9 @@
+Category of Endofunctors
+All endofunctors of \(\C\) form the category \(\E_\C\) of endofunctors of \(\C\).
+
+- \(\ob{\E_\C}\): endofunctors of \(\C\) ; \(F:\C→\C\)
+- \(\hom{\E_\C}\): natural transformations ; \(η:F→G\) s.t.
+
+- η function \( \ob{\C} → \hom{\C}, f:X→Y, η(Y)∘F(f)=G(f)∘η(X) \)
+
+
diff --git a/categories/30_How/131.md b/categories/30_How/131.md
new file mode 100644
index 0000000..3c37218
--- /dev/null
+++ b/categories/30_How/131.md
@@ -0,0 +1,12 @@
+Category of Endofunctors
+------------------------
+
+All endofunctors of \\(\\C\\)
+form the category \\(\\E\_\\C\\)
+of endofunctors of \\(\\C\\).
+
+- \\(\\ob{\\E\_\\C}\\): endofunctors of \\(\\C\\) ; \\(F:\\C→\\C\\)
+- \\(\\hom{\\E\_\\C}\\): natural transformations ; \\(η:F→G\\) s.t.
+ - η function \\( \\ob{\\C} → \\hom{\\C}, f:X→Y, η(Y)∘F(f)=G(f)∘η(X) \\)
+ - ex: if `F` and `G` are Haskell functors,
+ then the polymorphic functions `F a -> G a` are the natural transformations.
diff --git a/categories/30_How/140_Monads.html b/categories/30_How/140_Monads.html
new file mode 100644
index 0000000..bd0ea88
--- /dev/null
+++ b/categories/30_How/140_Monads.html
@@ -0,0 +1,7 @@
+Monads
+
+A Monad is just a monoid in the category of endofunctors, what's the problem?
+
+
+All told, a monad in X is just a monoid in the category of endofunctors of X, with product × replaced by composition of endofunctors and unit set by the identity endofunctor.
+
diff --git a/categories/30_How/140_Monads.md b/categories/30_How/140_Monads.md
new file mode 100644
index 0000000..be0a674
--- /dev/null
+++ b/categories/30_How/140_Monads.md
@@ -0,0 +1,8 @@
+Monads
+------
+
+> A Monad is just a monoid in the category of endofunctors, what's the problem?
+
+> All told, a monad in X is just a monoid in the category of endofunctors of X,
+> with product × replaced by composition of endofunctors
+> and unit set by the identity endofunctor.
diff --git a/categories/head.html b/categories/head.html
index b747bc1..29b48ba 100644
--- a/categories/head.html
+++ b/categories/head.html
@@ -34,6 +34,7 @@
\(\newcommand{\F}{\mathbf{F}}\)
+\(\newcommand{\E}{\mathbf{E}}\)
\(\newcommand{\C}{\mathcal{C}}\)
\(\newcommand{\D}{\mathcal{D}}\)
\(\newcommand{\id}{\mathrm{id}}\)
@@ -47,6 +48,7 @@
\(\newcommand{\ML}{\mathbf{ML}}\)
\(\newcommand{\Hask}{\mathbf{Hask}}\)
\(\newcommand{\Cat}{\mathbf{Cat}}\)
+\(\newcommand{\fmap}{\mathtt{fmap}}\)