From 6e08bf59becd4501448d0d81605826d9909963ce Mon Sep 17 00:00:00 2001
From: Yann Esposito
length
can be seen as a Functor from the category [a]
to Int
. More precisely:
length
can be seen as a Functor from the category [a]
to the cateogry Int
:
F a -> G a
are the natural transformations.F a -> G a
.data Tree a = Empty | Node a [Tree a]
- deriving (Show)
toTree :: [a] -> Tree a
toTree [] = Empty
toTree (x:xs) = Node x [toTree xs]
@@ -677,9 +676,8 @@ toTree (x:xs) = Node x [toTree xs]
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)
@@ -687,13 +685,13 @@ toList (Node x l) = [x] ++ concat (map toList l)
toList
is a natural transformation. It is also a morphism from Tree
to []
in the Category of \(\) endofunctors.
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]
-
-toMaybe :: [a] -> Maybe a
-toMaybe [] = Nothing
-toMaybe (x:xs) = Just x
-
-toMaybe
is a natural transformation. It is also a morphism from []
to Maybe
in the Category of \(\) endofunctors.
length
can be seen as a Functor from the category [a]
to Int
. More precisely:
length
can be seen as a Functor from the category [a]
to the cateogry Int
:
F a -> G a
are the natural transformations.F a -> G a
.data Tree a = Empty | Node a [Tree a]
- deriving (Show)
toTree :: [a] -> Tree a
toTree [] = Empty
toTree (x:xs) = Node x [toTree xs]
diff --git a/categories/30_How/170_Natural_Transformation_Examples.md b/categories/30_How/170_Natural_Transformation_Examples.md
index 40402f5..71dca39 100644
--- a/categories/30_How/170_Natural_Transformation_Examples.md
+++ b/categories/30_How/170_Natural_Transformation_Examples.md
@@ -1,8 +1,7 @@
-Natural Transformation Examples
--------------------------------
+Natural Transformation Examples (1/3)
+------------------------------------
data Tree a = Empty | Node a [Tree a]
- deriving (Show)
toTree :: [a] -> Tree a
toTree [] = Empty
toTree (x:xs) = Node x [toTree xs]
diff --git a/categories/30_How/180_Natural_Transformation_Examples.html b/categories/30_How/180_Natural_Transformation_Examples.html
index 90b6c69..30962c3 100644
--- a/categories/30_How/180_Natural_Transformation_Examples.html
+++ b/categories/30_How/180_Natural_Transformation_Examples.html
@@ -1,6 +1,5 @@
-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)
@@ -8,7 +7,7 @@ toList (Node x l) = [x] ++ concat (map toList l)
toList
is a natural transformation. It is also a morphism from Tree
to []
in the Category of \(\) endofunctors.
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)
@@ -14,7 +13,7 @@ It is also a morphism from `Tree` to `[]` in the Category of \\(\Hask\\) endofun
diff --git a/categories/30_How/190_Another_Nat_Trans_Example.html b/categories/30_How/190_Another_Nat_Trans_Example.html
index 193e7aa..d8807ad 100644
--- a/categories/30_How/190_Another_Nat_Trans_Example.html
+++ b/categories/30_How/190_Another_Nat_Trans_Example.html
@@ -1,4 +1,4 @@
-
toMaybe :: [a] -> Maybe a ; mToList :: Maybe a -> [a]
toMaybe [] = Nothing ; mToList Nothing = []
diff --git a/categories/30_How/190_Another_Nat_Trans_Example.md b/categories/30_How/190_Another_Nat_Trans_Example.md
index 854cf7b..85f4cb5 100644
--- a/categories/30_How/190_Another_Nat_Trans_Example.md
+++ b/categories/30_How/190_Another_Nat_Trans_Example.md
@@ -1,5 +1,5 @@
-Another Nat. Trans. Example
----------------------------
+Natural Transformation Examples (3/3)
+-------------------------------------
toMaybe :: [a] -> Maybe a ; mToList :: Maybe a -> [a]
diff --git a/categories/30_How/200_Another_Nat_Trans_Example.html b/categories/30_How/200_Another_Nat_Trans_Example.html
deleted file mode 100644
index 7e54ab4..0000000
--- a/categories/30_How/200_Another_Nat_Trans_Example.html
+++ /dev/null
@@ -1,13 +0,0 @@
-Another Nat. Trans. Example
-
-toMaybe :: [a] -> Maybe a
-toMaybe [] = Nothing
-toMaybe (x:xs) = Just x
-
-toMaybe
is a natural transformation. It is also a morphism from []
to Maybe
in the Category of \(\) endofunctors.
-
-
-
-
diff --git a/categories/30_How/200_Another_Nat_Trans_Example.md b/categories/30_How/200_Another_Nat_Trans_Example.md
deleted file mode 100644
index f7b4920..0000000
--- a/categories/30_How/200_Another_Nat_Trans_Example.md
+++ /dev/null
@@ -1,19 +0,0 @@
-Another Nat. Trans. Example
----------------------------
-
-
-toMaybe :: [a] -> Maybe a
-toMaybe [] = Nothing
-toMaybe (x:xs) = Just x
-
-
-`toMaybe` is a natural transformation.
-It is also a morphism from `[]` to `Maybe` in the Category of \\(\Hask\\) endofunctors.
-
-
-
diff --git a/themes/style/y/main.css b/themes/style/y/main.css
index 189e606..3e715c1 100644
--- a/themes/style/y/main.css
+++ b/themes/style/y/main.css
@@ -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 {
diff --git a/themes/style/y/main.sass b/themes/style/y/main.sass
index 8e9160d..850803d 100644
--- a/themes/style/y/main.sass
+++ b/themes/style/y/main.sass
@@ -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