You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

231 lines 7.4 KiB Raw Permalink Blame History

             Category Theory for Programming                                                          


Category Theory & Programming 
by Yann Esposito 
   @yogsototh,      +yogsototh   




  


Plan



• Why?
•  
• What?
•  
• How?
•  

  


Abstraction Example



Something you see very often but in different instances.



Once you recognize the notion, you see it almost everywhere.



• Numbers: 0,1,2,3,... (3400 BC, real numbers 760 BC)
•  
• Rational numbers: $$\frac{p}{q}$$ (concept is prehistoric)
•  
• Negative numbers: ..., -3, -2, -1, 0, 1, 2, ... (100-50 BC)
•  
• Irrational numbers: $$\mathbb{A}$$, $$\mathbb{R}$$ (500 BC → Pythogoras killed Hippasus because of $$\sqrt{2}$$!)
•  
• Complex numbers: $$\mathbb{C}$$ (100 AD, then 16th century)
•  

  


Numbers ⇒ Set Theory ($$\infty$$)

  
$$\mathbb{N}$$: $$(+,0)$$Semigroups
$$\mathbb{Z}$$: $$(+,0,\times,1)$$Rings
$$\mathbb{Q}$$Fields
$$\mathbb{R}$$Complete Fields (topology)
$$\mathbb{C}$$Algebræ
Modules,Vector Spaces, Monoids, ...
                                                  

More general: more things are sets.
 & More precise: clear distinction between concepts)

   


Set Theory ⇒? Category Theory

  
NumbersSet Theory ($$\infty$$)Category Theory (relations)
$$\mathbb{N}$$: $$(+,0)$$Semigroups?
$$\mathbb{Z}$$: $$(+,0,\times,1)$$Rings?
$$\mathbb{Q}$$Fields?
$$\mathbb{R}$$Complete Fields (topology)?
$$\mathbb{C}$$Algebræ?
Modules,Vector Spaces, Monoids, ...?
                                                                 


/.*/ ⇒? Category Theory



• Topology ⇒ Category Theory
•  
• Quantum Physics ⇒ Category Theory
•  
• Logic ⇒ Category Theory
•  
• Programming ⇒ Category Theory
•  


More general: more things are sets.
 & More precise: clear distinction between concepts)


  


too much abstraction?



More general & more precise


  


Animation, Math & Code



Some math $$\sum_{i=1}^\infty \frac{1}{2^x} = 1$$



Another math formula $$\sum_{i=1}^\infty \frac{1}{2^x} = 1$$


 
main :: IO()
main = do
    putStrLn \$ "Hello !"


                
   /   
   
            #