From 6e08bf59becd4501448d0d81605826d9909963ce Mon Sep 17 00:00:00 2001 From: Yann Esposito Date: Fri, 7 Dec 2012 12:17:02 +0100 Subject: [PATCH] some fixes --- categories.html | 29 ++++--------------- .../30_How/150_Also_Functor_inside_Hask.html | 2 +- .../30_How/160_Category_of_Endofunctors.html | 2 +- .../30_How/160_Category_of_Endofunctors.md | 3 +- .../170_Natural_Transformation_Examples.html | 3 +- .../170_Natural_Transformation_Examples.md | 5 ++-- .../180_Natural_Transformation_Examples.html | 5 ++-- .../180_Natural_Transformation_Examples.md | 9 +++--- .../30_How/190_Another_Nat_Trans_Example.html | 2 +- .../30_How/190_Another_Nat_Trans_Example.md | 4 +-- .../30_How/200_Another_Nat_Trans_Example.html | 13 --------- .../30_How/200_Another_Nat_Trans_Example.md | 19 ------------ themes/style/y/main.css | 18 +++++++----- themes/style/y/main.sass | 1 + 14 files changed, 32 insertions(+), 83 deletions(-) delete mode 100644 categories/30_How/200_Another_Nat_Trans_Example.html delete mode 100644 categories/30_How/200_Another_Nat_Trans_Example.md diff --git a/categories.html b/categories.html index a4c6512..d0971e4 100644 --- a/categories.html +++ b/categories.html @@ -630,7 +630,7 @@ Haskell types is fractal:

Also Functor inside \(\Hask\)

-

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:

-

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]
@@ -677,9 +676,8 @@ toTree (x:xs) = Node x [toTree xs]
-

Natural Transformation Examples

+

Natural Transformation Examples (2/3)

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.

natural transformation commutative diagram
-natural transformation commutative diagram
toList.toTree=id & toTree.toList=id.
Therefore [] & Tree are isomorph.
+natural transformation commutative diagram
toList . toTree = id &
toTree . toList = id &
therefore [] & Tree are isomorph.
-

Another Nat. Trans. Example

+

Natural Transformation Examples (3/3)


 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]
 
 
 
-
-
-

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.

-natural transformation commutative diagram -
-natural transformation commutative diagram
There is no isomorphism.
Hint: List with more than one element.
-
- -

Monads

diff --git a/categories/30_How/150_Also_Functor_inside_Hask.html b/categories/30_How/150_Also_Functor_inside_Hask.html index e0ecb2f..7477095 100644 --- a/categories/30_How/150_Also_Functor_inside_Hask.html +++ b/categories/30_How/150_Also_Functor_inside_Hask.html @@ -1,5 +1,5 @@

Also Functor inside \(\Hask\)

-

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:

  • \(\ob{\mathtt{[a]}}=\{∙\}\)
  • \(\hom{\mathtt{[a]}}=\mathtt{[a]}\)
  • diff --git a/categories/30_How/160_Category_of_Endofunctors.html b/categories/30_How/160_Category_of_Endofunctors.html index 908aa60..7c8dfca 100644 --- a/categories/30_How/160_Category_of_Endofunctors.html +++ b/categories/30_How/160_Category_of_Endofunctors.html @@ -6,6 +6,6 @@
  • \(\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...
      Rearragement functions only.
    • +
    • for Haskell functors: F a -> G a.
      Rearragement functions only.
diff --git a/categories/30_How/160_Category_of_Endofunctors.md b/categories/30_How/160_Category_of_Endofunctors.md index 0209120..945ba04 100644 --- a/categories/30_How/160_Category_of_Endofunctors.md +++ b/categories/30_How/160_Category_of_Endofunctors.md @@ -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. diff --git a/categories/30_How/170_Natural_Transformation_Examples.html b/categories/30_How/170_Natural_Transformation_Examples.html index 86a90c4..9cd45aa 100644 --- a/categories/30_How/170_Natural_Transformation_Examples.html +++ b/categories/30_How/170_Natural_Transformation_Examples.html @@ -1,6 +1,5 @@ -

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/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 @@ -

Natural Transformation Examples

+

Natural Transformation Examples (2/3)

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.

natural transformation commutative diagram
-natural transformation commutative diagram
toList.toTree=id & toTree.toList=id.
Therefore [] & Tree are isomorph.
+natural transformation commutative diagram
toList . toTree = id &
toTree . toList = id &
therefore [] & Tree are isomorph.
diff --git a/categories/30_How/180_Natural_Transformation_Examples.md b/categories/30_How/180_Natural_Transformation_Examples.md index 1253fa2..c5274cd 100644 --- a/categories/30_How/180_Natural_Transformation_Examples.md +++ b/categories/30_How/180_Natural_Transformation_Examples.md @@ -1,8 +1,7 @@ -Natural Transformation Examples -------------------------------- +Natural Transformation Examples (2/3) +------------------------------------
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 natural transformation commutative diagram
natural transformation commutative diagram -
toList.toTree=id & toTree.toList=id.
-Therefore [] & Tree are isomorph. +
toList . toTree = id &
toTree . toList = id &
+therefore [] & Tree are isomorph.
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 @@ -

Another Nat. Trans. Example

+

Natural Transformation Examples (3/3)


 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.

-natural transformation commutative diagram -
-natural transformation commutative diagram
There is no isomorphism.
Hint: List with more than one element.
-
- - 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. - -natural transformation commutative diagram -
-natural transformation commutative diagram -
There is no isomorphism.
-Hint: List with more than one element. -
-
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