diff --git a/categories.html b/categories.html index d0971e4..9195162 100644 --- a/categories.html +++ b/categories.html @@ -648,20 +648,26 @@ Haskell types is fractal:

-

Category of Endofunctors

-

All endofunctors of \(\C\) form the category \(\E_\C\) of endofunctors of \(\C\).

-Natural transformation commutative diagram - +

Category of \(\Hask\) Endofunctors

+Category of Hask endofunctors
-

Natural Transformation Examples (1/3)

+

Category of Functors

+

If \(\C\) is small (\(\hom{\C}\) is a set). All functors from \(\C\) to some category \(\D\) form the category \(\mathrm{Func}(\C,\D)\).

+Natural transformation commutative diagram + +

\(\mathrm{Func}(\C,\C)\) is the category of endofunctors of \(\C\).

+
+
+

Natural Transformation Examples (1/4)

data Tree a = Empty | Node a [Tree a]
 toTree :: [a] -> Tree a
 toTree [] = Empty
@@ -676,7 +682,7 @@ toTree (x:xs) = Node x [toTree xs]
-

Natural Transformation Examples (2/3)

+

Natural Transformation Examples (2/4)

data Tree a = Empty | Node a [Tree a]
 toList :: Tree a -> [a]
 toList Empty = []
@@ -691,17 +697,29 @@ toList (Node x l) = [x] ++ concat (map toList l)
-

Natural Transformation Examples (3/3)

-

-toMaybe :: [a] -> Maybe a   ;   mToList :: Maybe a -> [a]
-toMaybe [] = Nothing        ;   mToList Nothing = []
-toMaybe (x:xs) = Just x     ;   mToList Just x  = [x]
-
+

Natural Transformation Examples (3/4)

+
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: Bool lists longer than 1.
+natural transformation commutative diagram +
+ + +
+
+

Natural Transformation Examples (4/4)

+
mToList :: Maybe a -> [a]
+mToList Nothing = []
+mToList Just x  = [x]
+ +

toMaybe is a natural transformation. It is also a morphism from [] to Maybe in the Category of \(\) endofunctors.

+natural transformation commutative diagram +
+relation between [] and Maybe
There is no isomorphism.
Hint: Bool lists longer than 1.
diff --git a/categories/30_How/160_Category_of_Endofunctors.html b/categories/30_How/160_Category_of_Endofunctors.html deleted file mode 100644 index 7c8dfca..0000000 --- a/categories/30_How/160_Category_of_Endofunctors.html +++ /dev/null @@ -1,11 +0,0 @@ -

Category of Endofunctors

-

All endofunctors of \(\C\) form the category \(\E_\C\) of endofunctors of \(\C\).

-Natural transformation commutative diagram -
    -
  • \(\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.
      Rearragement functions only.
    • -
  • -
diff --git a/categories/30_How/160_Category_of_Endofunctors.md b/categories/30_How/160_Category_of_Endofunctors.md deleted file mode 100644 index 945ba04..0000000 --- a/categories/30_How/160_Category_of_Endofunctors.md +++ /dev/null @@ -1,15 +0,0 @@ -Category of Endofunctors ------------------------- - - -All endofunctors of \\(\\C\\) -form the category \\(\\E\_\\C\\) -of endofunctors of \\(\\C\\). - -Natural transformation commutative diagram - -- \\(\\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`. - Rearragement functions only. diff --git a/categories/30_How/160_Category_of_Hask_Endofunctors.html b/categories/30_How/160_Category_of_Hask_Endofunctors.html new file mode 100644 index 0000000..8949904 --- /dev/null +++ b/categories/30_How/160_Category_of_Hask_Endofunctors.html @@ -0,0 +1,2 @@ +

Category of \(\Hask\) Endofunctors

+Category of Hask endofunctors diff --git a/categories/30_How/160_Category_of_Hask_Endofunctors.md b/categories/30_How/160_Category_of_Hask_Endofunctors.md new file mode 100644 index 0000000..2650eeb --- /dev/null +++ b/categories/30_How/160_Category_of_Hask_Endofunctors.md @@ -0,0 +1,4 @@ +Category of \\(\\Hask\\) Endofunctors +------------------------------------ + +Category of Hask endofunctors diff --git a/categories/30_How/170_Category_of_Functors.html b/categories/30_How/170_Category_of_Functors.html new file mode 100644 index 0000000..db654b6 --- /dev/null +++ b/categories/30_How/170_Category_of_Functors.html @@ -0,0 +1,13 @@ +

Category of Functors

+

If \(\C\) is small (\(\hom{\C}\) is a set). All functors from \(\C\) to some category \(\D\) form the category \(\mathrm{Func}(\C,\D)\).

+Natural transformation commutative diagram +
    +
  • \(\ob{\mathrm{Func}(\C,\D)}\): Functors \(F:\C→\D\)
  • +
  • \(\hom{\mathrm{Func}(\C,\D)}\): natural transformations +
      +
    • η familly \(η_X\in\hom{\D}\) for \(X\in\ob{\C}\) s.t.
    • +
    • ex: between Haskel functors; F a -> G a
      Rearragement functions only.
    • +
  • +
  • ∘: Functor composition
  • +
+

\(\mathrm{Func}(\C,\C)\) is the category of endofunctors of \(\C\).

diff --git a/categories/30_How/170_Category_of_Functors.md b/categories/30_How/170_Category_of_Functors.md new file mode 100644 index 0000000..aac320b --- /dev/null +++ b/categories/30_How/170_Category_of_Functors.md @@ -0,0 +1,18 @@ +Category of Functors +------------------------ + +If \\(\\C\\) is _small_ (\\(\\hom{\\C}\\) is a set). +All functors from \\(\\C\\) to some category \\(\\D\\) +form the category \\(\\mathrm{Func}(\\C,\\D)\\). + +Natural transformation commutative diagram + +- \\(\\ob{\\mathrm{Func}(\\C,\\D)}\\): Functors \\(F:\\C→\\D\\) +- \\(\\hom{\\mathrm{Func}(\\C,\\D)}\\): _natural transformations_ + - η familly \\(η\_X\\in\\hom{\\D}\\) for \\(X\\in\\ob{\\C}\\) s.t. + - ex: between Haskel functors; `F a -> G a` + Rearragement functions only. +- ∘: Functor composition + + +\\(\\mathrm{Func}(\\C,\\C)\\) is the category of endofunctors of \\(\\C\\). diff --git a/categories/30_How/170_Natural_Transformation_Examples.html b/categories/30_How/180_Natural_Transformation_Examples_1_4.html similarity index 87% rename from categories/30_How/170_Natural_Transformation_Examples.html rename to categories/30_How/180_Natural_Transformation_Examples_1_4.html index 9cd45aa..1a7b14c 100644 --- a/categories/30_How/170_Natural_Transformation_Examples.html +++ b/categories/30_How/180_Natural_Transformation_Examples_1_4.html @@ -1,4 +1,4 @@ -

Natural Transformation Examples (1/3)

+

Natural Transformation Examples (1/4)

data Tree a = Empty | Node a [Tree a]
 toTree :: [a] -> Tree a
 toTree [] = Empty
diff --git a/categories/30_How/170_Natural_Transformation_Examples.md b/categories/30_How/180_Natural_Transformation_Examples_1_4.md
similarity index 94%
rename from categories/30_How/170_Natural_Transformation_Examples.md
rename to categories/30_How/180_Natural_Transformation_Examples_1_4.md
index 71dca39..9a6bd3d 100644
--- a/categories/30_How/170_Natural_Transformation_Examples.md
+++ b/categories/30_How/180_Natural_Transformation_Examples_1_4.md
@@ -1,4 +1,4 @@
-Natural Transformation Examples (1/3)
+Natural Transformation Examples (1/4)
 ------------------------------------
 
 
data Tree a = Empty | Node a [Tree a]
diff --git a/categories/30_How/190_Another_Nat_Trans_Example.html b/categories/30_How/190_Another_Nat_Trans_Example.html
deleted file mode 100644
index d8807ad..0000000
--- a/categories/30_How/190_Another_Nat_Trans_Example.html
+++ /dev/null
@@ -1,14 +0,0 @@
-

Natural Transformation Examples (3/3)

-

-toMaybe :: [a] -> Maybe a   ;   mToList :: Maybe a -> [a]
-toMaybe [] = Nothing        ;   mToList Nothing = []
-toMaybe (x:xs) = Just x     ;   mToList Just x  = [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: Bool lists longer than 1.
-
- - diff --git a/categories/30_How/180_Natural_Transformation_Examples.html b/categories/30_How/190_Natural_Transformation_Examples_2_4.html similarity index 90% rename from categories/30_How/180_Natural_Transformation_Examples.html rename to categories/30_How/190_Natural_Transformation_Examples_2_4.html index 30962c3..63306ec 100644 --- a/categories/30_How/180_Natural_Transformation_Examples.html +++ b/categories/30_How/190_Natural_Transformation_Examples_2_4.html @@ -1,4 +1,4 @@ -

Natural Transformation Examples (2/3)

+

Natural Transformation Examples (2/4)

data Tree a = Empty | Node a [Tree a]
 toList :: Tree a -> [a]
 toList Empty = []
diff --git a/categories/30_How/180_Natural_Transformation_Examples.md b/categories/30_How/190_Natural_Transformation_Examples_2_4.md
similarity index 95%
rename from categories/30_How/180_Natural_Transformation_Examples.md
rename to categories/30_How/190_Natural_Transformation_Examples_2_4.md
index c5274cd..bd3212a 100644
--- a/categories/30_How/180_Natural_Transformation_Examples.md
+++ b/categories/30_How/190_Natural_Transformation_Examples_2_4.md
@@ -1,4 +1,4 @@
-Natural Transformation Examples (2/3)
+Natural Transformation Examples (2/4)
 ------------------------------------
 
 
data Tree a = Empty | Node a [Tree a]
diff --git a/categories/30_How/200_Natural_Transformation_Examples_3_4.html b/categories/30_How/200_Natural_Transformation_Examples_3_4.html
new file mode 100644
index 0000000..ee5ebc9
--- /dev/null
+++ b/categories/30_How/200_Natural_Transformation_Examples_3_4.html
@@ -0,0 +1,12 @@
+

Natural Transformation Examples (3/4)

+
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 +
+ + diff --git a/categories/30_How/190_Another_Nat_Trans_Example.md b/categories/30_How/200_Natural_Transformation_Examples_3_4.md similarity index 55% rename from categories/30_How/190_Another_Nat_Trans_Example.md rename to categories/30_How/200_Natural_Transformation_Examples_3_4.md index 85f4cb5..42040a7 100644 --- a/categories/30_How/190_Another_Nat_Trans_Example.md +++ b/categories/30_How/200_Natural_Transformation_Examples_3_4.md @@ -1,11 +1,9 @@ -Natural Transformation Examples (3/3) +Natural Transformation Examples (3/4) ------------------------------------- -

-toMaybe :: [a] -> Maybe a   ;   mToList :: Maybe a -> [a]
-toMaybe [] = Nothing        ;   mToList Nothing = []
-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. @@ -14,7 +12,4 @@ It is also a morphism from `[]` to `Maybe` in the Category of \\(\Hask\\) endofu natural transformation commutative diagram
natural transformation commutative diagram -
There is no isomorphism.
-Hint: Bool lists longer than 1. -
diff --git a/categories/30_How/210_Natural_Transformation_Examples_4_4.html b/categories/30_How/210_Natural_Transformation_Examples_4_4.html new file mode 100644 index 0000000..f6ec1df --- /dev/null +++ b/categories/30_How/210_Natural_Transformation_Examples_4_4.html @@ -0,0 +1,12 @@ +

Natural Transformation Examples (4/4)

+
mToList :: Maybe a -> [a]
+mToList Nothing = []
+mToList Just x  = [x]
+ +

toMaybe is a natural transformation. It is also a morphism from [] to Maybe in the Category of \(\) endofunctors.

+natural transformation commutative diagram +
+relation between [] and Maybe
There is no isomorphism.
Hint: Bool lists longer than 1.
+
+ + diff --git a/categories/30_How/210_Natural_Transformation_Examples_4_4.md b/categories/30_How/210_Natural_Transformation_Examples_4_4.md new file mode 100644 index 0000000..519ea17 --- /dev/null +++ b/categories/30_How/210_Natural_Transformation_Examples_4_4.md @@ -0,0 +1,18 @@ +Natural Transformation Examples (4/4) +------------------------------------- + +
mToList :: Maybe a -> [a]
+mToList Nothing = []
+mToList Just x  = [x]
+ + +`toMaybe` is a natural transformation. +It is also a morphism from `[]` to `Maybe` in the Category of \\(\Hask\\) endofunctors. + +natural transformation commutative diagram +
+relation between [] and Maybe +
There is no isomorphism.
+Hint: Bool lists longer than 1. +
+
diff --git a/categories/30_How/210_Monads.html b/categories/30_How/220_Monads.html similarity index 100% rename from categories/30_How/210_Monads.html rename to categories/30_How/220_Monads.html diff --git a/categories/30_How/210_Monads.md b/categories/30_How/220_Monads.md similarity index 100% rename from categories/30_How/210_Monads.md rename to categories/30_How/220_Monads.md diff --git a/categories/30_How/220_Monads_are_just_monoids_1_4.html b/categories/30_How/230_Monads_are_just_monoids_1_4.html similarity index 100% rename from categories/30_How/220_Monads_are_just_monoids_1_4.html rename to categories/30_How/230_Monads_are_just_monoids_1_4.html diff --git a/categories/30_How/220_Monads_are_just_monoids_1_4.md b/categories/30_How/230_Monads_are_just_monoids_1_4.md similarity index 100% rename from categories/30_How/220_Monads_are_just_monoids_1_4.md rename to categories/30_How/230_Monads_are_just_monoids_1_4.md diff --git a/categories/30_How/230_Monads_are_just_Monoids_2_4.html b/categories/30_How/240_Monads_are_just_Monoids_2_4.html similarity index 100% rename from categories/30_How/230_Monads_are_just_Monoids_2_4.html rename to categories/30_How/240_Monads_are_just_Monoids_2_4.html diff --git a/categories/30_How/230_Monads_are_just_Monoids_2_4.md b/categories/30_How/240_Monads_are_just_Monoids_2_4.md similarity index 100% rename from categories/30_How/230_Monads_are_just_Monoids_2_4.md rename to categories/30_How/240_Monads_are_just_Monoids_2_4.md diff --git a/categories/30_How/240_Monads_are_just_Monoids_3_4.html b/categories/30_How/250_Monads_are_just_Monoids_3_4.html similarity index 100% rename from categories/30_How/240_Monads_are_just_Monoids_3_4.html rename to categories/30_How/250_Monads_are_just_Monoids_3_4.html diff --git a/categories/30_How/240_Monads_are_just_Monoids_3_4.md b/categories/30_How/250_Monads_are_just_Monoids_3_4.md similarity index 100% rename from categories/30_How/240_Monads_are_just_Monoids_3_4.md rename to categories/30_How/250_Monads_are_just_Monoids_3_4.md diff --git a/categories/30_How/250_Monads_are_just_Monoids_4_4.html b/categories/30_How/260_Monads_are_just_Monoids_4_4.html similarity index 100% rename from categories/30_How/250_Monads_are_just_Monoids_4_4.html rename to categories/30_How/260_Monads_are_just_Monoids_4_4.html diff --git a/categories/30_How/250_Monads_are_just_Monoids_4_4.md b/categories/30_How/260_Monads_are_just_Monoids_4_4.md similarity index 100% rename from categories/30_How/250_Monads_are_just_Monoids_4_4.md rename to categories/30_How/260_Monads_are_just_Monoids_4_4.md diff --git a/categories/30_How/260_Monads_generalize_composition.html b/categories/30_How/270_Monads_generalize_composition.html similarity index 100% rename from categories/30_How/260_Monads_generalize_composition.html rename to categories/30_How/270_Monads_generalize_composition.html diff --git a/categories/30_How/260_Monads_generalize_composition.md b/categories/30_How/270_Monads_generalize_composition.md similarity index 100% rename from categories/30_How/260_Monads_generalize_composition.md rename to categories/30_How/270_Monads_generalize_composition.md diff --git a/categories/30_How/270_Monads_utility.html b/categories/30_How/280_Monads_utility.html similarity index 100% rename from categories/30_How/270_Monads_utility.html rename to categories/30_How/280_Monads_utility.html diff --git a/categories/img/mp/cat-hask-endofunctor.mp b/categories/img/mp/cat-hask-endofunctor.mp new file mode 100644 index 0000000..c799041 --- /dev/null +++ b/categories/img/mp/cat-hask-endofunctor.mp @@ -0,0 +1,108 @@ +% DPI 180 +pair int,bool,func,intlist,list; +resize(.8cm); +int=origin; +% drawoptions (withcolor baseOne withpen pencircle scaled 1.2); + +intlist=int shifted (gu,0); +func=int shifted (0,-.6gu); +bool=func shifted (gu,0); +list=func shifted (2u,0); + + +drawLoopPoint(int,int shifted (0,1.6u),"\mathtt{sqrt}"); +drawEdge(int,int,"\mathtt{id}"); +drawEdgeAngle(int,bool,"\mathtt{odd}",-30); +drawEdgeAngle(int,bool,"\mathtt{even}",30); +drawEdge(intlist,intlist,"\mathtt{tail}"); +drawEdge(intlist,int,"\mathtt{length}"); + +% ---------- F ---------------- + +pair decal; +pair fint,fbool,ffunc,fintlist,flist; +decal := (-1.2gu,-1.5gu); +fint=int shifted decal; +fintlist=intlist shifted decal; +ffunc= func shifted decal; +fbool= bool shifted decal; +flist= list shifted decal; + +drawLoopPoint(fint,fint shifted (0,1.9u),"\scriptstyle\mathtt{fmap\ sqrt}"); +drawEdge(fint,fint,"\scriptstyle\mathtt{fmap\ id}"); +drawEdgeAngle(fint,fbool,"\scriptstyle\mathtt{fmap\ odd}",-30); +drawEdgeAngle(fint,fbool,"\scriptstyle\mathtt{fmap\ even}",30); +drawEdge(fintlist,fintlist,"\scriptstyle\mathtt{fmap\ tail}"); +drawEdge(fintlist,fint,"\scriptstyle\mathtt{fmap\ length}"); + +drawblock(fint,fbool,"\mathtt{F}"); + +pair ff; +ff = .5[fint,fintlist] shifted (0,u); +path b; +b := block(origin,origin); +draw b scaled .5 shifted ff; +label.top(btex $\mathtt{F\ F}$ etex, blockLabelPosition(b)) scaled .5 shifted ff; +draw b scaled .25 shifted ff; +label.top(btex $\mathtt{F\ F\ F}$ etex, blockLabelPosition(b)) scaled .25 shifted ff; + +% ------------ G -------------- +pair gdecal; +pair gint,gbool,gfunc,gintlist,glist; +gdecal := (1.2gu,-1.5gu); +gint=int shifted gdecal; +gintlist=intlist shifted gdecal; +gfunc= func shifted gdecal; +gbool= bool shifted gdecal; +glist= list shifted gdecal; + +drawLoopPoint(gint,gint shifted (0,1.9u),"\scriptstyle\mathtt{fmap\ sqrt}"); +drawEdge(gint,gint,"\scriptstyle\mathtt{fmap\ id}"); +drawEdgeAngle(gint,gbool,"\scriptstyle\mathtt{fmap\ odd}",-30); +drawEdgeAngle(gint,gbool,"\scriptstyle\mathtt{fmap\ even}",30); +drawEdge(gintlist,gintlist,"\scriptstyle\mathtt{fmap\ tail}"); +drawEdge(gintlist,gint,"\scriptstyle\mathtt{fmap\ length}"); + +drawblock(gint,gbool,"\mathtt{G}"); + +pair gf; +gf = .5[gint,gintlist] shifted (0,u); +path b; +b := block(origin,origin); +draw b scaled .5 shifted gf; +label.top(btex $\mathtt{G\ G}$ etex, blockLabelPosition(b)) scaled .5 shifted gf; +draw b scaled .25 shifted gf; +label.top(btex $\mathtt{G\ G\ G}$ etex, blockLabelPosition(b)) scaled .25 shifted gf; + + +drawState(int,"\mathtt{Int}"); +drawState(intlist,"\mathtt{[Int]}"); +drawState(func,"\mathtt{a\rightarrow b}"); +drawState(list,"\mathtt{[a]}"); +drawState(bool,"\mathtt{Bool}"); + +drawState(fint,"\mathtt{F\ Int}"); +drawState(fintlist,"\mathtt{F\ [Int]}"); +drawState(ffunc,"\mathtt{F\ a\rightarrow b}"); +drawState(flist,"\mathtt{F\ [a]}"); +drawState(fbool,"\mathtt{F\ Bool}"); + +drawState(gint,"\mathtt{G\ Int}"); +drawState(gintlist,"\mathtt{G\ [Int]}"); +drawState(gfunc,"\mathtt{G\ a\rightarrow b}"); +drawState(glist,"\mathtt{G\ [a]}"); +drawState(gbool,"\mathtt{G\ Bool}"); + +drawoptions(withcolor yellow); +label.top(btex $I$ etex, .5[int,intlist] shifted (0,u)); + +drawoptions(withpen pencircle scaled 2bp withcolor yellow); +ahlength:=.3u; + +drawEdgeAngle(.5[int,func] shifted (-.5u,0), ff shifted (0,2.2u), "?", -30); +drawEdgeAngle(ff shifted (-u,2.2u), .5[int,func] shifted (-.5u,u), "?", 30); +drawEdgeAngle(.5[intlist,bool] shifted (.5u,0), gf shifted (0,2.2u), "?", 30); +drawEdgeAngle(gf shifted (u,2.2u), .5[intlist,bool] shifted (.5u,u), "?", -30); + +drawEdgeAngle(.5[fintlist,fbool] shifted (1.1u,u), .5[gint,gfunc] shifted (-1.1u,u), "?", 30); +drawEdgeAngle(.5[gint,gfunc] shifted (-1.1u,u), .5[fintlist,fbool] shifted (1.1u,u), "?", 30); diff --git a/categories/img/mp/cat-hask-endofunctor.png b/categories/img/mp/cat-hask-endofunctor.png new file mode 100644 index 0000000..12bd247 Binary files /dev/null and b/categories/img/mp/cat-hask-endofunctor.png differ diff --git a/categories/img/mp/gen b/categories/img/mp/gen index e553ff2..7274185 100755 --- a/categories/img/mp/gen +++ b/categories/img/mp/gen @@ -64,9 +64,15 @@ for fpfic in $listfic; do | sed 's/green/s_green/g' > $tmp [[ -e $old ]] && diff $tmp $old >/dev/null && { echo " identical"; continue } - print -- "[$PWD]: mpost $tmp && convert -density 300 $tmp.1 $png" + dpi=$(grep '% DPI' $tmp | awk '{print $3}') + [[ $dpi = "" ]] && dpi=600 + + print + print "[DPI]: $dpi" + + print -- "[$PWD]: mpost $tmp && convert -density $dpi $tmp.1 $png" mpost --tex=latex $tmp && \ - convert -colorspace rgb -density 600 $eps '(' +clone -background black -shadow 90x4+0+1 ')' +swap -background none -layers merge +repage $png && \ + convert -colorspace rgb -density $dpi $eps '(' +clone -background black -shadow 90x4+0+1 ')' +swap -background none -layers merge +repage $png && \ \cp -f $png $scriptdir && \ \cp -f $tmp $old && \ echo "updated" diff --git a/categories/img/mp/list-maybe-endofunctor-morphism.mp b/categories/img/mp/list-maybe-endofunctor-morphism.mp index af3fb88..c0b21d7 100644 --- a/categories/img/mp/list-maybe-endofunctor-morphism.mp +++ b/categories/img/mp/list-maybe-endofunctor-morphism.mp @@ -1,8 +1,8 @@ pair tree,list; resize(.8cm); + list=origin; tree=list shifted (gu,0); drawState(list,"\mathtt{[]}"); drawState(tree,"\mathtt{Maybe}"); drawEdgeAngle(list,tree,"\mathtt{toMaybe}",30); -drawEdgeAngle(tree,list,"\mathtt{mToList}",30); diff --git a/categories/img/mp/list-maybe-endofunctor-morphism.png b/categories/img/mp/list-maybe-endofunctor-morphism.png index 8342e57..cdd02eb 100644 Binary files a/categories/img/mp/list-maybe-endofunctor-morphism.png and b/categories/img/mp/list-maybe-endofunctor-morphism.png differ diff --git a/categories/img/mp/maybe-list-endofunctor-morphsm.mp b/categories/img/mp/maybe-list-endofunctor-morphsm.mp new file mode 100644 index 0000000..bd302c1 --- /dev/null +++ b/categories/img/mp/maybe-list-endofunctor-morphsm.mp @@ -0,0 +1,9 @@ +pair tree,list; +resize(.8cm); +list=origin; + +tree=list shifted (gu,0); +drawState(list,"\mathtt{[]}"); +drawState(tree,"\mathtt{Maybe}"); +drawEdgeAngle(list,tree,"\mathtt{toMaybe}",30); +drawEdgeAngle(tree,list,"\mathtt{mToList}",30); diff --git a/categories/img/mp/maybe-list-endofunctor-morphsm.png b/categories/img/mp/maybe-list-endofunctor-morphsm.png new file mode 100644 index 0000000..9951405 Binary files /dev/null and b/categories/img/mp/maybe-list-endofunctor-morphsm.png differ diff --git a/categories/img/mp/nattrans-list-maybe.mp b/categories/img/mp/nattrans-list-maybe.mp index 170ff9d..ed2af14 100644 --- a/categories/img/mp/nattrans-list-maybe.mp +++ b/categories/img/mp/nattrans-list-maybe.mp @@ -18,11 +18,3 @@ label.lft(btex $\mathtt{toMaybe}$ etex,midpoint(ab)); ac:=edge(z1,z3); drawarrow ac; label.rt(btex $\mathtt{toMaybe}$ etex,midpoint(ac)); - -path abb,acb; -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{mToList}$ etex,midpoint(abb)); -label.lft(btex $\mathtt{mToList}$ etex,midpoint(acb)); diff --git a/categories/img/mp/nattrans-list-maybe.png b/categories/img/mp/nattrans-list-maybe.png index 7a1c487..480df03 100644 Binary files a/categories/img/mp/nattrans-list-maybe.png and b/categories/img/mp/nattrans-list-maybe.png differ diff --git a/categories/img/mp/nattrans-maybe-list.mp b/categories/img/mp/nattrans-maybe-list.mp new file mode 100644 index 0000000..4ffb30a --- /dev/null +++ b/categories/img/mp/nattrans-maybe-list.mp @@ -0,0 +1,21 @@ +z0=(0,0); +z1=(1.5gu,0); +z2=(0,-gu); +z3=(1.5gu,-gu); +path ac,ab; + +label(btex $\mathtt{[a]}$ etex,z0); +label(btex $\mathtt{[b]}$ etex,z1); +label(btex $\mathtt{Maybe\ a}$ etex,z2 shifted (-u,0)); +label(btex $\mathtt{Maybe\ b}$ etex,z3 shifted (u,0)); + +drawEdge(z0,z1,"\mathtt{fmap_{[]}\ f}"); +drawEdge(z2,z3,"\mathtt{fmap_{Maybe}\ f}"); + +path abb,acb; +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{mToList}$ etex,midpoint(abb)); +label.lft(btex $\mathtt{mToList}$ etex,midpoint(acb)); diff --git a/categories/img/mp/nattrans-maybe-list.png b/categories/img/mp/nattrans-maybe-list.png new file mode 100644 index 0000000..e9881d5 Binary files /dev/null and b/categories/img/mp/nattrans-maybe-list.png differ