by febin · 6y ago · 0 comments
Seven Sketches in Compositionality: An Invitation to Applied Category Theory https://arxiv.org/abs/1803.05316
Applied Category Theory mini-course: https://ocw.mit.edu/courses/mathematics/18-s097-applied-cate...
Programming with Categories mini-course (with Bartosz Milewski): http://brendanfong.com/programmingcats.html
* A conference series + workshop: https://www.appliedcategorytheory.org/
* A journal: https://compositionality-journal.org/
Check out some of the people involved in organizing these events. Names I've followed include John Baez, Pawel Sobocinski, and Tai-Danae Bradley (all of whom are amazing educators; check out their work!).
Tai-Danae Bradley wrote a pamphlet on applied category theory which is very approachable: https://arxiv.org/pdf/1809.05923.pdf . Also check out Jules Hedges' thoughts on the importance of compositionality: https://julesh.com/2017/04/22/on-compositionality/ .
https://bartoszmilewski.com/2014/10/28/category-theory-for-p...
There is also a playlist on Youtube
https://www.youtube.com/watch?v=I8LbkfSSR58&list=PLbgaMIhjbm...
To do io you need monads. There's come from category theory. Haskell is great fun to learn, very different, focus on abstractions and abstractions of abstractions. One the one hand i highly recommend it. On the other the vast majority of people learning it never do any useful work at all in haskell. (This last statement will probably excite the haskell zealots whom I would encourage to reply with evidence.)
There are about 5 programs i know if that you might use written in haskell for a purpose other than programming a computer.
Anyway category theory definitely comes up in lazy, pure functional programming. A lot.
That being said, when you explicitly model side effects, you invariably end up with some kind of monad in your model. Food for thought: in a logic programming setting, where your domain is some flavor of partially ordered set, monads are closure operators (a kind of monotone function). Closure operators give a cool foundation for the semantics of certain kinds of logic paradigms, such as concurrent constraint programming.
I come from the other side, Milewski's book is to me "Functional Programming for Category Theorists".
I suppose my statement was a bit strong in that regard. Monads tend to arise very often in the way we build systems, but that doesn't mean they're the only way to cope with side-effects. It does seem likely that any way to capture "alternate outputs" from a function will end up looking like A -> T(B) in some category, though.
(Incidentally, if "A -> T(B)" looks funky, think about polynomials `f(x)` -- the function symbol `f` is just a placeholder for some expression involving the free variable `x`. Could be `A -> (B, String)`. The monad laws only make sure you have some foundation for reasoning about the extra type structure being added in by `T`.)