Category Theory in Computing Languages

ChefCouscous's avatarMath Online Tom Circle

​Is there any connection between category theory and the way computer languages work?by Thorsten Altenkirch

Yes, lots.

Just one example: a function with 2 inputs from A and B and results from C would have the type A x B -> C but in functional languages like Haskell we are using A -> (B -> C), i.e. a function that returns a function. This “currying” is exactly a the categorical definition of a cartesian closed category as one where Hom(AxB,C) is isomorphic to Hom(A,B -> C) and in this false you can replace Hom(X,Y) with X -> Y.

It is well known that effects in functional programming can be modelled by monads which is a concept from category theory. Nowadays a weaker structure called applicative functors has become very popular – needless to say also a concept from Category Theory.

Not all languages are functional (yet) but…

View original post 24 more words

Unknown's avatar

Author: tomcircle

Math amateur

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.