Finished with conclusion
This commit is contained in:
parent
67616fcc15
commit
5042e727f2
66 changed files with 361 additions and 262 deletions
142
categories.html
142
categories.html
|
@ -260,16 +260,6 @@ such that for each \(f:A→B\):</p>
|
|||
</figure>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2>Question Time!</h2>
|
||||
|
||||
<figure style="width:70%; margin:0 auto">
|
||||
<img src="categories/img/batquestion.jpg" width="100%"/>
|
||||
<figcaption>
|
||||
<em>- French-only joke -</em>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2>Can this be a category?</h2>
|
||||
<p>\(\ob{\C},\hom{\C}\) fixed, is there a valid ∘?</p>
|
||||
<figure class="left">
|
||||
|
@ -293,6 +283,16 @@ such that for each \(f:A→B\):</p>
|
|||
</figure>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2>Question Time!</h2>
|
||||
|
||||
<figure style="width:70%; margin:0 auto">
|
||||
<img src="categories/img/batquestion.jpg" width="100%"/>
|
||||
<figcaption>
|
||||
<em>- French-only joke -</em>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2>Can this be a category?</h2>
|
||||
<figure class="left">
|
||||
<img src="categories/img/mp/cat-example4.png" alt="Category example 4"/>
|
||||
|
@ -742,7 +742,7 @@ mToList Just x = [x]</pre>
|
|||
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. <span class="and">&</span> Composition generalization</h2>
|
||||
<h2 id="composition-problem">Composition problem</h2>
|
||||
<p>The Problem; example with lists:</p>
|
||||
<pre class="haskell"><code>f x = [x] ⇒ f 1 = [1] ⇒ (f.f) 1 = [[1]] ✗
|
||||
g x = [x+1] ⇒ g 1 = [2] ⇒ (g.g) 1 = ERROR [2]+1 ✗
|
||||
|
@ -751,15 +751,15 @@ h x = [x+1,x*3] ⇒ h 1 = [2,3] ⇒ (h.h) 1 = ERROR [2,3]+1 ✗ </code></pre>
|
|||
<p>The same problem with most <code>f :: a -> F a</code> functions and functor <code>F</code>.</p>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. <span class="and">&</span> Composition generalization</h2>
|
||||
<h2 id="composition-fixable">Composition Fixable?</h2>
|
||||
<p>How to fix that? We want to construct an operator which is able to compose:</p>
|
||||
<p><code>f :: a -> F b</code> <span class="and">&</span> <code>g :: b -> F c</code>.</p>
|
||||
<p>More specifically we want to create an operator ◎ of type</p>
|
||||
<p><code>◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)</code></p>
|
||||
<p>Note: if <code>F</code> = I, ◎ = ∘.</p>
|
||||
<p>Note: if <code>F</code> = I, ◎ = <code>(.)</code>.</p>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. <span class="and">&</span> Composition generalization</h2>
|
||||
<h2 id="fix-composition-12">Fix Composition (1/2)</h2>
|
||||
<p>Goal, find: <code>◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)</code><br /><code>f :: a -> F b</code>, <code>g :: b -> F c</code>:</p>
|
||||
<ul>
|
||||
<li><code>(g ◎ f) x</code> ???</li>
|
||||
|
@ -768,7 +768,7 @@ h x = [x+1,x*3] ⇒ h 1 = [2,3] ⇒ (h.h) 1 = ERROR [2,3]+1 ✗ </code></pre>
|
|||
</ul>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. <span class="and">&</span> Composition generalization</h2>
|
||||
<h2 id="fix-composition-22">Fix Composition (2/2)</h2>
|
||||
<p>Goal, find: <code>◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)</code><br /><code>f :: a -> F b</code>, <code>g :: b -> F c</code>, <span class="yellow"><code>f x :: F b</code></span>:</p>
|
||||
<ul>
|
||||
<li>Use <code>fmap :: (t -> u) -> (F t -> F u)</code>!</li>
|
||||
|
@ -779,7 +779,7 @@ h x = [x+1,x*3] ⇒ h 1 = [2,3] ⇒ (h.h) 1 = ERROR [2,3]+1 ✗ </code></pre>
|
|||
</ul>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. <span class="and">&</span> Composition generalization</h2>
|
||||
<h2 id="necessary-laws">Necessary laws</h2>
|
||||
<p>For ◎ to work like composition, we need join to hold the following properties:</p>
|
||||
<ul>
|
||||
<li><code>join (join (F (F (F a))))=join (F (join (F (F a))))</code></li>
|
||||
|
@ -866,8 +866,8 @@ join (η [x]) = [x] = join [η x]</code></pre>
|
|||
<p>Therefore <code>([],join,η)</code> is a monad.</p>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="monads-utility">Monads utility</h2>
|
||||
<p>A monad can also hide computation details (ex: a common parameter).</p>
|
||||
<h2 id="monads-utility">Monads useful?</h2>
|
||||
<p>A <em>LOT</em> of monad tutorial on the net. Just one example; the State Monad</p>
|
||||
<p><code>DrawScene</code> to <code><span class="yellow">State Screen</span> DrawScene</code> ; still <b>pure</b>.</p>
|
||||
<pre class="haskell left smaller" style="width:40%"><code>main = drawImage (width,height)
|
||||
|
||||
|
@ -905,63 +905,97 @@ drawPoint p = do
|
|||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="κατα-morphism-fold-generalization">κατα-morphism: fold generalization</h2>
|
||||
<p>Typically, you need a recursive type (list, trees, ...)</p>
|
||||
<pre><code>Str = Cons Char Str
|
||||
<p><code>acc</code> type of the "accumulator":<br /><code>fold :: (acc -> a -> acc) -> acc -> [a] -> acc</code></p>
|
||||
<p>Idea: put the accumulated value inside the type.</p>
|
||||
<pre class="haskell"><code>-- Equivalent to fold (+1) 0 "cata"
|
||||
(Cons 'c' (Cons 'a' (Cons 't' (Cons 'a' Nil))))
|
||||
(Cons 'c' (Cons 'a' (Cons 't' (Cons 'a' <span style="border: solid 1px;">0</span>))))
|
||||
(Cons 'c' (Cons 'a' (Cons 't' <span style="border: solid 1px;">1</span>)))
|
||||
(Cons 'c' (Cons 'a' <span style="border: solid 1px;">2</span>))
|
||||
(Cons 'c' <span style="border: solid 1px;">3</span>)
|
||||
<span style="border: solid 1px;">4</span></code></pre>
|
||||
|
||||
1st: replace the recursive type by another type.
|
||||
StrChar a = Cons Char a
|
||||
Str' a = Mu StrChar
|
||||
|
||||
Str' = InF { outF :: StrChar (Mu ListElement) }
|
||||
Str' = InF { outF :: StrChar (Str') }</code></pre>
|
||||
<p>Clearly <code>Str'</code> is isomorph <code>String</code>.</p>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
<p>But where are all the informations? <code>(+1)</code> and <code>0</code>?</p>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="κατα-morphism-missing-information">κατα-morphism: Missing Information</h2>
|
||||
<p>Where is the missing information?</p>
|
||||
<ul>
|
||||
<li>Functor operator <code>fmap</code></li>
|
||||
<li>Algebra representing the <code>(+1)</code> and also knowing the <code>0</code>.</li>
|
||||
</ul>
|
||||
<p>First example, make <code>length</code> on <code>[Char]</code></p>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="κατα-morphism-type-work">κατα-morphism: Type work</h2>
|
||||
<pre class="haskell"><code>
|
||||
data StrF a = Cons Char a | Nil
|
||||
data Str = StrF Str
|
||||
|
||||
-- generalize the construction of Str to other datatype
|
||||
-- Mu :: type fixed point
|
||||
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
data Str = Mu StrF
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
-- Example
|
||||
foo=InF { outF = Cons 'f'
|
||||
(InF { outF = Cons 'o'
|
||||
(InF { outF = Cons 'o'
|
||||
(InF { outF = Nil })})})}</code></pre>
|
||||
|
||||
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="κατα-morphism-missing-information-retrieved">κατα-morphism: missing information retrieved</h2>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
instance Functor (StrF a) =
|
||||
fmap f (Cons c x) = Cons c (f x)
|
||||
fmap _ Nil = Nil</code></pre>
|
||||
<pre><code>cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF</code></pre>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="κατα-morphism-example-with-strings">κατα-morphism: example with strings</h2>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
|
||||
-- Example with natural fold on String
|
||||
data StrF x = Cons Char x | Nil
|
||||
type Str = Mu StrF
|
||||
instance Functor StrF where
|
||||
fmap f (Cons a as) = Cons a (f as)
|
||||
fmap _ Nil = Nil
|
||||
<h2 id="κατα-morphism-finally-length">κατα-morphism: Finally length</h2>
|
||||
<p>All needed information for making length.</p>
|
||||
<pre><code>instance Functor (StrF a) =
|
||||
fmap f (Cons c x) = Cons c (f x)
|
||||
fmap _ Nil = Nil
|
||||
|
||||
length' :: Str -> Int
|
||||
length' = cata phi where
|
||||
phi (Cons a b) = 1 + b
|
||||
phi Nil = 0
|
||||
phi :: Algebra StrF Int -- StrF Int -> Int
|
||||
phi (Cons a b) = 1 + b
|
||||
phi Nil = 0
|
||||
|
||||
toMu :: [Char] -> Str
|
||||
toMu (x:xs) = InF { outF = Cons x (toMu xs) }
|
||||
toMu [] = InF { outF = Nil }</code></pre>
|
||||
main = do
|
||||
l <- length' $ stringToStr "Toto"
|
||||
...</code></pre>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="κατα-morphism-example-with-strings">κατα-morphism: example with strings</h2>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
|
||||
type Tree = Mu TreeF
|
||||
<h2 id="κατα-morphism-extension-to-trees">κατα-morphism: extension to Trees</h2>
|
||||
<p>Once you get the trick, it is easy to extent to most Functor.</p>
|
||||
<pre><code>type Tree = Mu TreeF
|
||||
data TreeF x = Node Int [x]
|
||||
|
||||
instance Functor TreeF where
|
||||
fmap f (Node e xs) = Node e (fmap f xs)
|
||||
|
||||
depth = cata phi where
|
||||
phi :: Algebra TreeF Int -- TreeF Int -> Int
|
||||
phi (Node x sons) = 1 + foldr max 0 sons</code></pre>
|
||||
</section>
|
||||
<section class="slide">
|
||||
<h2 id="conclusion">Conclusion</h2>
|
||||
<p>Category Theory oriented Programming:</p>
|
||||
<ul>
|
||||
<li>Focus on the type and operators</li>
|
||||
<li>Extreme generalisation</li>
|
||||
<li>Better modularity</li>
|
||||
<li>Better control through properties of types</li>
|
||||
</ul>
|
||||
</section>
|
||||
<!-- End slides. -->
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. & Composition generalization</h2>
|
||||
<h2 id="composition-problem">Composition problem</h2>
|
||||
<p>The Problem; example with lists:</p>
|
||||
<pre class="haskell"><code>f x = [x] ⇒ f 1 = [1] ⇒ (f.f) 1 = [[1]] ✗
|
||||
g x = [x+1] ⇒ g 1 = [2] ⇒ (g.g) 1 = ERROR [2]+1 ✗
|
|
@ -1,4 +1,4 @@
|
|||
Nat. Trans. & Composition generalization
|
||||
Composition problem
|
||||
--------------------------------------------
|
||||
|
||||
The Problem; example with lists:
|
|
@ -1,6 +1,6 @@
|
|||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. & Composition generalization</h2>
|
||||
<h2 id="composition-fixable">Composition Fixable?</h2>
|
||||
<p>How to fix that? We want to construct an operator which is able to compose:</p>
|
||||
<p><code>f :: a -> F b</code> & <code>g :: b -> F c</code>.</p>
|
||||
<p>More specifically we want to create an operator ◎ of type</p>
|
||||
<p><code>◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)</code></p>
|
||||
<p>Note: if <code>F</code> = I, ◎ = ∘.</p>
|
||||
<p>Note: if <code>F</code> = I, ◎ = <code>(.)</code>.</p>
|
|
@ -1,4 +1,4 @@
|
|||
Nat. Trans. & Composition generalization
|
||||
Composition Fixable?
|
||||
--------------------------------------------
|
||||
|
||||
How to fix that? We want to construct an operator which is able to compose:
|
||||
|
@ -9,4 +9,4 @@ More specifically we want to create an operator ◎ of type
|
|||
|
||||
`◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)`
|
||||
|
||||
Note: if `F` = I, ◎ = ∘.
|
||||
Note: if `F` = I, ◎ = `(.)`.
|
|
@ -1,4 +1,4 @@
|
|||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. & Composition generalization</h2>
|
||||
<h2 id="fix-composition-12">Fix Composition (1/2)</h2>
|
||||
<p>Goal, find: <code>◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)</code><br /><code>f :: a -> F b</code>, <code>g :: b -> F c</code>:</p>
|
||||
<ul>
|
||||
<li><code>(g ◎ f) x</code> ???</li>
|
|
@ -1,4 +1,4 @@
|
|||
Nat. Trans. & Composition generalization
|
||||
Fix Composition (1/2)
|
||||
--------------------------------------------
|
||||
|
||||
Goal, find: `◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)`
|
|
@ -1,4 +1,4 @@
|
|||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. & Composition generalization</h2>
|
||||
<h2 id="fix-composition-22">Fix Composition (2/2)</h2>
|
||||
<p>Goal, find: <code>◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)</code><br /><code>f :: a -> F b</code>, <code>g :: b -> F c</code>, <span class="yellow"><code>f x :: F b</code></span>:</p>
|
||||
<ul>
|
||||
<li>Use <code>fmap :: (t -> u) -> (F t -> F u)</code>!</li>
|
|
@ -1,4 +1,4 @@
|
|||
Nat. Trans. & Composition generalization
|
||||
Fix Composition (2/2)
|
||||
--------------------------------------------
|
||||
|
||||
Goal, find: `◎ :: (b -> F c) -> (a -> F b) -> (a -> F c)`
|
|
@ -1,4 +1,4 @@
|
|||
<h2 id="nat.-trans.-composition-generalization">Nat. Trans. & Composition generalization</h2>
|
||||
<h2 id="necessary-laws">Necessary laws</h2>
|
||||
<p>For ◎ to work like composition, we need join to hold the following properties:</p>
|
||||
<ul>
|
||||
<li><code>join (join (F (F (F a))))=join (F (join (F (F a))))</code></li>
|
|
@ -1,4 +1,4 @@
|
|||
Nat. Trans. & Composition generalization
|
||||
Necessary laws
|
||||
--------------------------------------------
|
||||
|
||||
For ◎ to work like composition, we need join to hold the following properties:
|
|
@ -1,5 +1,5 @@
|
|||
<h2 id="monads-utility">Monads utility</h2>
|
||||
<p>A monad can also hide computation details (ex: a common parameter).</p>
|
||||
<h2 id="monads-utility">Monads useful?</h2>
|
||||
<p>A <em>LOT</em> of monad tutorial on the net. Just one example; the State Monad</p>
|
||||
<p><code>DrawScene</code> to <code><span class="yellow">State Screen</span> DrawScene</code> ; still <b>pure</b>.</p>
|
||||
<pre class="haskell left smaller" style="width:40%"><code>main = drawImage (width,height)
|
||||
|
|
@ -1,16 +1,13 @@
|
|||
<h2 id="κατα-morphism-fold-generalization">κατα-morphism: fold generalization</h2>
|
||||
<p>Typically, you need a recursive type (list, trees, ...)</p>
|
||||
<pre><code>Str = Cons Char Str
|
||||
<p><code>acc</code> type of the "accumulator":<br /><code>fold :: (acc -> a -> acc) -> acc -> [a] -> acc</code></p>
|
||||
<p>Idea: put the accumulated value inside the type.</p>
|
||||
<pre class="haskell"><code>-- Equivalent to fold (+1) 0 "cata"
|
||||
(Cons 'c' (Cons 'a' (Cons 't' (Cons 'a' Nil))))
|
||||
(Cons 'c' (Cons 'a' (Cons 't' (Cons 'a' <span style="border: solid 1px;">0</span>))))
|
||||
(Cons 'c' (Cons 'a' (Cons 't' <span style="border: solid 1px;">1</span>)))
|
||||
(Cons 'c' (Cons 'a' <span style="border: solid 1px;">2</span>))
|
||||
(Cons 'c' <span style="border: solid 1px;">3</span>)
|
||||
<span style="border: solid 1px;">4</span></code></pre>
|
||||
|
||||
1st: replace the recursive type by another type.
|
||||
StrChar a = Cons Char a
|
||||
Str' a = Mu StrChar
|
||||
|
||||
Str' = InF { outF :: StrChar (Mu ListElement) }
|
||||
Str' = InF { outF :: StrChar (Str') }</code></pre>
|
||||
<p>Clearly <code>Str'</code> is isomorph <code>String</code>.</p>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF</code></pre>
|
||||
<p>But where are all the informations? <code>(+1)</code> and <code>0</code>?</p>
|
||||
|
|
|
@ -1,25 +1,18 @@
|
|||
κατα-morphism: fold generalization
|
||||
----------------------------------
|
||||
|
||||
Typically, you need a recursive type (list, trees, ...)
|
||||
`acc` type of the "accumulator":
|
||||
`fold :: (acc -> a -> acc) -> acc -> [a] -> acc`
|
||||
|
||||
~~~
|
||||
Str = Cons Char Str
|
||||
Idea: put the accumulated value inside the type.
|
||||
|
||||
1st: replace the recursive type by another type.
|
||||
StrChar a = Cons Char a
|
||||
Str' a = Mu StrChar
|
||||
<pre class="haskell"><code>-- Equivalent to fold (+1) 0 "cata"
|
||||
(Cons 'c' (Cons 'a' (Cons 't' (Cons 'a' Nil))))
|
||||
(Cons 'c' (Cons 'a' (Cons 't' (Cons 'a' <span style="border: solid 1px;">0</span>))))
|
||||
(Cons 'c' (Cons 'a' (Cons 't' <span style="border: solid 1px;">1</span>)))
|
||||
(Cons 'c' (Cons 'a' <span style="border: solid 1px;">2</span>))
|
||||
(Cons 'c' <span style="border: solid 1px;">3</span>)
|
||||
<span style="border: solid 1px;">4</span></code></pre>
|
||||
|
||||
Str' = InF { outF :: StrChar (Mu ListElement) }
|
||||
Str' = InF { outF :: StrChar (Str') }
|
||||
~~~
|
||||
|
||||
Clearly `Str'` is isomorph `String`.
|
||||
|
||||
~~~
|
||||
type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
~~~
|
||||
But where are all the informations? `(+1)` and `0`?
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<h2 id="κατα-morphism-missing-information">κατα-morphism: Missing Information</h2>
|
||||
<p>Where is the missing information?</p>
|
||||
<ul>
|
||||
<li>Functor operator <code>fmap</code></li>
|
||||
<li>Algebra representing the <code>(+1)</code> and also knowing the <code>0</code>.</li>
|
||||
</ul>
|
||||
<p>First example, make <code>length</code> on <code>[Char]</code></p>
|
|
@ -0,0 +1,9 @@
|
|||
κατα-morphism: Missing Information
|
||||
----------------------------------
|
||||
|
||||
Where is the missing information?
|
||||
|
||||
- Functor operator `fmap`
|
||||
- Algebra representing the `(+1)` and also knowing the `0`.
|
||||
|
||||
First example, make `length` on `[Char]`
|
|
@ -1,22 +0,0 @@
|
|||
<h2 id="κατα-morphism-example-with-strings">κατα-morphism: example with strings</h2>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
|
||||
-- Example with natural fold on String
|
||||
data StrF x = Cons Char x | Nil
|
||||
type Str = Mu StrF
|
||||
instance Functor StrF where
|
||||
fmap f (Cons a as) = Cons a (f as)
|
||||
fmap _ Nil = Nil
|
||||
|
||||
length' :: Str -> Int
|
||||
length' = cata phi where
|
||||
phi (Cons a b) = 1 + b
|
||||
phi Nil = 0
|
||||
|
||||
toMu :: [Char] -> Str
|
||||
toMu (x:xs) = InF { outF = Cons x (toMu xs) }
|
||||
toMu [] = InF { outF = Nil }</code></pre>
|
|
@ -1,26 +0,0 @@
|
|||
κατα-morphism: example with strings
|
||||
-----------------------------------
|
||||
|
||||
~~~
|
||||
type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
|
||||
-- Example with natural fold on String
|
||||
data StrF x = Cons Char x | Nil
|
||||
type Str = Mu StrF
|
||||
instance Functor StrF where
|
||||
fmap f (Cons a as) = Cons a (f as)
|
||||
fmap _ Nil = Nil
|
||||
|
||||
length' :: Str -> Int
|
||||
length' = cata phi where
|
||||
phi (Cons a b) = 1 + b
|
||||
phi Nil = 0
|
||||
|
||||
toMu :: [Char] -> Str
|
||||
toMu (x:xs) = InF { outF = Cons x (toMu xs) }
|
||||
toMu [] = InF { outF = Nil }
|
||||
~~~
|
18
categories/30_How/300_Catamorphisms/045.html
Normal file
18
categories/30_How/300_Catamorphisms/045.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<h2 id="κατα-morphism-type-work">κατα-morphism: Type work</h2>
|
||||
<pre class="haskell"><code>
|
||||
data StrF a = Cons Char a | Nil
|
||||
data Str = StrF Str
|
||||
|
||||
-- generalize the construction of Str to other datatype
|
||||
-- Mu :: type fixed point
|
||||
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
data Str = Mu StrF
|
||||
|
||||
-- Example
|
||||
foo=InF { outF = Cons 'f'
|
||||
(InF { outF = Cons 'o'
|
||||
(InF { outF = Cons 'o'
|
||||
(InF { outF = Nil })})})}</code></pre>
|
||||
|
||||
|
18
categories/30_How/300_Catamorphisms/045.md
Normal file
18
categories/30_How/300_Catamorphisms/045.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
κατα-morphism: Type work
|
||||
------------------------
|
||||
|
||||
<pre class="haskell"><code>
|
||||
data StrF a = Cons Char a | Nil
|
||||
data Str = StrF Str
|
||||
|
||||
-- generalize the construction of Str to other datatype
|
||||
-- Mu :: type fixed point
|
||||
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
data Str = Mu StrF
|
||||
|
||||
-- Example
|
||||
foo=InF { outF = Cons 'f'
|
||||
(InF { outF = Cons 'o'
|
||||
(InF { outF = Cons 'o'
|
||||
(InF { outF = Nil })})})}</code></pre>
|
|
@ -1,15 +0,0 @@
|
|||
<h2 id="κατα-morphism-example-with-strings">κατα-morphism: example with strings</h2>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
|
||||
type Tree = Mu TreeF
|
||||
data TreeF x = Node Int [x]
|
||||
|
||||
instance Functor TreeF where
|
||||
fmap f (Node e xs) = Node e (fmap f xs)
|
||||
|
||||
depth = cata phi where
|
||||
phi (Node x sons) = 1 + foldr max 0 sons</code></pre>
|
|
@ -1,19 +0,0 @@
|
|||
κατα-morphism: example with strings
|
||||
-----------------------------------
|
||||
|
||||
~~~
|
||||
type Algebra f a = f a -> a
|
||||
data Mu f = InF { outF :: f (Mu f) }
|
||||
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
|
||||
type Tree = Mu TreeF
|
||||
data TreeF x = Node Int [x]
|
||||
|
||||
instance Functor TreeF where
|
||||
fmap f (Node e xs) = Node e (fmap f xs)
|
||||
|
||||
depth = cata phi where
|
||||
phi (Node x sons) = 1 + foldr max 0 sons
|
||||
~~~
|
|
@ -0,0 +1,7 @@
|
|||
<h2 id="κατα-morphism-missing-information-retrieved">κατα-morphism: missing information retrieved</h2>
|
||||
<pre><code>type Algebra f a = f a -> a
|
||||
instance Functor (StrF a) =
|
||||
fmap f (Cons c x) = Cons c (f x)
|
||||
fmap _ Nil = Nil</code></pre>
|
||||
<pre><code>cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF</code></pre>
|
|
@ -0,0 +1,15 @@
|
|||
κατα-morphism: missing information retrieved
|
||||
--------------------------------------------
|
||||
|
||||
~~~
|
||||
type Algebra f a = f a -> a
|
||||
instance Functor (StrF a) =
|
||||
fmap f (Cons c x) = Cons c (f x)
|
||||
fmap _ Nil = Nil
|
||||
~~~
|
||||
|
||||
~~~
|
||||
cata :: Functor f => Algebra f a -> Mu f -> a
|
||||
cata f = f . fmap (cata f) . outF
|
||||
~~~
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<h2 id="κατα-morphism-finally-length">κατα-morphism: Finally length</h2>
|
||||
<p>All needed information for making length.</p>
|
||||
<pre><code>instance Functor (StrF a) =
|
||||
fmap f (Cons c x) = Cons c (f x)
|
||||
fmap _ Nil = Nil
|
||||
|
||||
length' :: Str -> Int
|
||||
length' = cata phi where
|
||||
phi :: Algebra StrF Int -- StrF Int -> Int
|
||||
phi (Cons a b) = 1 + b
|
||||
phi Nil = 0
|
||||
|
||||
main = do
|
||||
l <- length' $ stringToStr "Toto"
|
||||
...</code></pre>
|
|
@ -0,0 +1,20 @@
|
|||
κατα-morphism: Finally length
|
||||
-----------------------------
|
||||
|
||||
All needed information for making length.
|
||||
|
||||
~~~
|
||||
instance Functor (StrF a) =
|
||||
fmap f (Cons c x) = Cons c (f x)
|
||||
fmap _ Nil = Nil
|
||||
|
||||
length' :: Str -> Int
|
||||
length' = cata phi where
|
||||
phi :: Algebra StrF Int -- StrF Int -> Int
|
||||
phi (Cons a b) = 1 + b
|
||||
phi Nil = 0
|
||||
|
||||
main = do
|
||||
l <- length' $ stringToStr "Toto"
|
||||
...
|
||||
~~~
|
|
@ -0,0 +1,11 @@
|
|||
<h2 id="κατα-morphism-extension-to-trees">κατα-morphism: extension to Trees</h2>
|
||||
<p>Once you get the trick, it is easy to extent to most Functor.</p>
|
||||
<pre><code>type Tree = Mu TreeF
|
||||
data TreeF x = Node Int [x]
|
||||
|
||||
instance Functor TreeF where
|
||||
fmap f (Node e xs) = Node e (fmap f xs)
|
||||
|
||||
depth = cata phi where
|
||||
phi :: Algebra TreeF Int -- TreeF Int -> Int
|
||||
phi (Node x sons) = 1 + foldr max 0 sons</code></pre>
|
|
@ -0,0 +1,16 @@
|
|||
κατα-morphism: extension to Trees
|
||||
----------------------------------
|
||||
|
||||
Once you get the trick, it is easy to extent to most Functor.
|
||||
|
||||
~~~
|
||||
type Tree = Mu TreeF
|
||||
data TreeF x = Node Int [x]
|
||||
|
||||
instance Functor TreeF where
|
||||
fmap f (Node e xs) = Node e (fmap f xs)
|
||||
|
||||
depth = cata phi where
|
||||
phi :: Algebra TreeF Int -- TreeF Int -> Int
|
||||
phi (Node x sons) = 1 + foldr max 0 sons
|
||||
~~~
|
8
categories/40_Conclusion/10_Conclusion.html
Normal file
8
categories/40_Conclusion/10_Conclusion.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<h2 id="conclusion">Conclusion</h2>
|
||||
<p>Category Theory oriented Programming:</p>
|
||||
<ul>
|
||||
<li>Focus on the type and operators</li>
|
||||
<li>Extreme generalisation</li>
|
||||
<li>Better modularity</li>
|
||||
<li>Better control through properties of types</li>
|
||||
</ul>
|
9
categories/40_Conclusion/10_Conclusion.md
Normal file
9
categories/40_Conclusion/10_Conclusion.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
Conclusion
|
||||
----------
|
||||
|
||||
Category Theory oriented Programming:
|
||||
|
||||
- Focus on the type and operators
|
||||
- Extreme generalisation
|
||||
- Better modularity
|
||||
- Better control through properties of types
|
|
@ -502,7 +502,8 @@ body.deck-container {
|
|||
margin: 0.5em 0;
|
||||
font-size: 0.7em; }
|
||||
.deck-container figure.left, .deck-container figure.right {
|
||||
max-width: 30%; }
|
||||
max-width: 30%;
|
||||
width: 30%; }
|
||||
.deck-container img.clean {
|
||||
border: none;
|
||||
background-color: none;
|
||||
|
@ -603,6 +604,7 @@ body.deck-container {
|
|||
margin-right: 1em; }
|
||||
.deck-container img.right {
|
||||
max-width: 30%;
|
||||
width: 30%;
|
||||
margin-top: 0.6em;
|
||||
margin-left: 1em; }
|
||||
.deck-container img.inside {
|
||||
|
@ -918,7 +920,7 @@ body.deck-container {
|
|||
max-height: 261px !important;
|
||||
padding: 0 5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -933,7 +935,7 @@ body.deck-container {
|
|||
max-height: 282.75px !important;
|
||||
padding: 0 5.41667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -948,7 +950,7 @@ body.deck-container {
|
|||
max-height: 304.5px !important;
|
||||
padding: 0 5.83333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -963,7 +965,7 @@ body.deck-container {
|
|||
max-height: 326.25px !important;
|
||||
padding: 0 6.25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -978,7 +980,7 @@ body.deck-container {
|
|||
max-height: 348px !important;
|
||||
padding: 0 6.66667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -993,7 +995,7 @@ body.deck-container {
|
|||
max-height: 369.75px !important;
|
||||
padding: 0 7.08333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1008,7 +1010,7 @@ body.deck-container {
|
|||
max-height: 391.5px !important;
|
||||
padding: 0 7.5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1023,7 +1025,7 @@ body.deck-container {
|
|||
max-height: 413.25px !important;
|
||||
padding: 0 7.91667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1038,7 +1040,7 @@ body.deck-container {
|
|||
max-height: 435px !important;
|
||||
padding: 0 8.33333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1053,7 +1055,7 @@ body.deck-container {
|
|||
max-height: 456.75px !important;
|
||||
padding: 0 8.75px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1068,7 +1070,7 @@ body.deck-container {
|
|||
max-height: 478.5px !important;
|
||||
padding: 0 9.16667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1083,7 +1085,7 @@ body.deck-container {
|
|||
max-height: 500.25px !important;
|
||||
padding: 0 9.58333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1098,7 +1100,7 @@ body.deck-container {
|
|||
max-height: 522px !important;
|
||||
padding: 0 10px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1113,7 +1115,7 @@ body.deck-container {
|
|||
max-height: 543.75px !important;
|
||||
padding: 0 10.41667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1128,7 +1130,7 @@ body.deck-container {
|
|||
max-height: 565.5px !important;
|
||||
padding: 0 10.83333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1143,7 +1145,7 @@ body.deck-container {
|
|||
max-height: 587.25px !important;
|
||||
padding: 0 11.25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1158,7 +1160,7 @@ body.deck-container {
|
|||
max-height: 609px !important;
|
||||
padding: 0 11.66667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1173,7 +1175,7 @@ body.deck-container {
|
|||
max-height: 630.75px !important;
|
||||
padding: 0 12.08333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1188,7 +1190,7 @@ body.deck-container {
|
|||
max-height: 652.5px !important;
|
||||
padding: 0 12.5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1203,7 +1205,7 @@ body.deck-container {
|
|||
max-height: 674.25px !important;
|
||||
padding: 0 12.91667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1218,7 +1220,7 @@ body.deck-container {
|
|||
max-height: 696px !important;
|
||||
padding: 0 13.33333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1233,7 +1235,7 @@ body.deck-container {
|
|||
max-height: 717.75px !important;
|
||||
padding: 0 13.75px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1248,7 +1250,7 @@ body.deck-container {
|
|||
max-height: 739.5px !important;
|
||||
padding: 0 14.16667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1263,7 +1265,7 @@ body.deck-container {
|
|||
max-height: 761.25px !important;
|
||||
padding: 0 14.58333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1278,7 +1280,7 @@ body.deck-container {
|
|||
max-height: 783px !important;
|
||||
padding: 0 15px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1293,7 +1295,7 @@ body.deck-container {
|
|||
max-height: 804.75px !important;
|
||||
padding: 0 15.41667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1308,7 +1310,7 @@ body.deck-container {
|
|||
max-height: 826.5px !important;
|
||||
padding: 0 15.83333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1323,7 +1325,7 @@ body.deck-container {
|
|||
max-height: 848.25px !important;
|
||||
padding: 0 16.25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1338,7 +1340,7 @@ body.deck-container {
|
|||
max-height: 870px !important;
|
||||
padding: 0 16.66667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1353,7 +1355,7 @@ body.deck-container {
|
|||
max-height: 891.75px !important;
|
||||
padding: 0 17.08333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1368,7 +1370,7 @@ body.deck-container {
|
|||
max-height: 913.5px !important;
|
||||
padding: 0 17.5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1383,7 +1385,7 @@ body.deck-container {
|
|||
max-height: 935.25px !important;
|
||||
padding: 0 17.91667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1398,7 +1400,7 @@ body.deck-container {
|
|||
max-height: 957px !important;
|
||||
padding: 0 18.33333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1413,7 +1415,7 @@ body.deck-container {
|
|||
max-height: 978.75px !important;
|
||||
padding: 0 18.75px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1428,7 +1430,7 @@ body.deck-container {
|
|||
max-height: 1000.5px !important;
|
||||
padding: 0 19.16667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1443,7 +1445,7 @@ body.deck-container {
|
|||
max-height: 1022.25px !important;
|
||||
padding: 0 19.58333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1458,7 +1460,7 @@ body.deck-container {
|
|||
max-height: 1044px !important;
|
||||
padding: 0 20px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1473,7 +1475,7 @@ body.deck-container {
|
|||
max-height: 1065.75px !important;
|
||||
padding: 0 20.41667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1488,7 +1490,7 @@ body.deck-container {
|
|||
max-height: 1087.5px !important;
|
||||
padding: 0 20.83333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1503,7 +1505,7 @@ body.deck-container {
|
|||
max-height: 1109.25px !important;
|
||||
padding: 0 21.25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1518,7 +1520,7 @@ body.deck-container {
|
|||
max-height: 1131px !important;
|
||||
padding: 0 21.66667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1533,7 +1535,7 @@ body.deck-container {
|
|||
max-height: 1152.75px !important;
|
||||
padding: 0 22.08333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1548,7 +1550,7 @@ body.deck-container {
|
|||
max-height: 1174.5px !important;
|
||||
padding: 0 22.5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1563,7 +1565,7 @@ body.deck-container {
|
|||
max-height: 1196.25px !important;
|
||||
padding: 0 22.91667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1578,7 +1580,7 @@ body.deck-container {
|
|||
max-height: 1218px !important;
|
||||
padding: 0 23.33333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1593,7 +1595,7 @@ body.deck-container {
|
|||
max-height: 1239.75px !important;
|
||||
padding: 0 23.75px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1608,7 +1610,7 @@ body.deck-container {
|
|||
max-height: 1261.5px !important;
|
||||
padding: 0 24.16667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1623,7 +1625,7 @@ body.deck-container {
|
|||
max-height: 1283.25px !important;
|
||||
padding: 0 24.58333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1638,7 +1640,7 @@ body.deck-container {
|
|||
max-height: 1305px !important;
|
||||
padding: 0 25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1653,7 +1655,7 @@ body.deck-container {
|
|||
max-height: 1326.75px !important;
|
||||
padding: 0 25.41667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1668,7 +1670,7 @@ body.deck-container {
|
|||
max-height: 1348.5px !important;
|
||||
padding: 0 25.83333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1683,7 +1685,7 @@ body.deck-container {
|
|||
max-height: 1370.25px !important;
|
||||
padding: 0 26.25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1698,7 +1700,7 @@ body.deck-container {
|
|||
max-height: 1392px !important;
|
||||
padding: 0 26.66667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1713,7 +1715,7 @@ body.deck-container {
|
|||
max-height: 1413.75px !important;
|
||||
padding: 0 27.08333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1728,7 +1730,7 @@ body.deck-container {
|
|||
max-height: 1435.5px !important;
|
||||
padding: 0 27.5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1743,7 +1745,7 @@ body.deck-container {
|
|||
max-height: 1457.25px !important;
|
||||
padding: 0 27.91667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1758,7 +1760,7 @@ body.deck-container {
|
|||
max-height: 1479px !important;
|
||||
padding: 0 28.33333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1773,7 +1775,7 @@ body.deck-container {
|
|||
max-height: 1500.75px !important;
|
||||
padding: 0 28.75px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1788,7 +1790,7 @@ body.deck-container {
|
|||
max-height: 1522.5px !important;
|
||||
padding: 0 29.16667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1803,7 +1805,7 @@ body.deck-container {
|
|||
max-height: 1544.25px !important;
|
||||
padding: 0 29.58333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1818,7 +1820,7 @@ body.deck-container {
|
|||
max-height: 1566px !important;
|
||||
padding: 0 30px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1833,7 +1835,7 @@ body.deck-container {
|
|||
max-height: 1587.75px !important;
|
||||
padding: 0 30.41667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1848,7 +1850,7 @@ body.deck-container {
|
|||
max-height: 1609.5px !important;
|
||||
padding: 0 30.83333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1863,7 +1865,7 @@ body.deck-container {
|
|||
max-height: 1631.25px !important;
|
||||
padding: 0 31.25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1878,7 +1880,7 @@ body.deck-container {
|
|||
max-height: 1653px !important;
|
||||
padding: 0 31.66667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1893,7 +1895,7 @@ body.deck-container {
|
|||
max-height: 1674.75px !important;
|
||||
padding: 0 32.08333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1908,7 +1910,7 @@ body.deck-container {
|
|||
max-height: 1696.5px !important;
|
||||
padding: 0 32.5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1923,7 +1925,7 @@ body.deck-container {
|
|||
max-height: 1718.25px !important;
|
||||
padding: 0 32.91667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1938,7 +1940,7 @@ body.deck-container {
|
|||
max-height: 1740px !important;
|
||||
padding: 0 33.33333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1953,7 +1955,7 @@ body.deck-container {
|
|||
max-height: 1761.75px !important;
|
||||
padding: 0 33.75px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1968,7 +1970,7 @@ body.deck-container {
|
|||
max-height: 1783.5px !important;
|
||||
padding: 0 34.16667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1983,7 +1985,7 @@ body.deck-container {
|
|||
max-height: 1805.25px !important;
|
||||
padding: 0 34.58333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -1998,7 +2000,7 @@ body.deck-container {
|
|||
max-height: 1827px !important;
|
||||
padding: 0 35px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -2013,7 +2015,7 @@ body.deck-container {
|
|||
max-height: 1848.75px !important;
|
||||
padding: 0 35.41667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -2028,7 +2030,7 @@ body.deck-container {
|
|||
max-height: 1870.5px !important;
|
||||
padding: 0 35.83333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -2043,7 +2045,7 @@ body.deck-container {
|
|||
max-height: 1892.25px !important;
|
||||
padding: 0 36.25px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -2058,7 +2060,7 @@ body.deck-container {
|
|||
max-height: 1914px !important;
|
||||
padding: 0 36.66667px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -2073,7 +2075,7 @@ body.deck-container {
|
|||
max-height: 1935.75px !important;
|
||||
padding: 0 37.08333px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
@ -2088,7 +2090,7 @@ body.deck-container {
|
|||
max-height: 1957.5px !important;
|
||||
padding: 0 37.5px !important;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px white inset;
|
||||
box-shadow: 0 0 10px #586e75 inset;
|
||||
height: 50%; }
|
||||
|
||||
.deck-container {
|
||||
|
|
|
@ -665,6 +665,7 @@ body.deck-container
|
|||
font-size: .7em
|
||||
figure.left,figure.right
|
||||
max-width: 30%
|
||||
width: 30%
|
||||
|
||||
img.clean
|
||||
border: none
|
||||
|
@ -785,6 +786,7 @@ body.deck-container
|
|||
|
||||
img.right
|
||||
max-width: 30%
|
||||
width: 30%
|
||||
margin:
|
||||
top: .6em
|
||||
left: 1em
|
||||
|
@ -1169,7 +1171,7 @@ $height:500
|
|||
max-height: #{$height}px !important
|
||||
padding: 0 #{$padsize}px !important
|
||||
margin: 0 auto
|
||||
box-shadow: 0 0 2px #FFF inset
|
||||
box-shadow: 0 0 10px $base01 inset
|
||||
height: 50%
|
||||
.deck-container
|
||||
font-size: #{$fontsize}px
|
||||
|
|
Loading…
Reference in a new issue