Intro

Category Theory looked scary when I first encountered it - a world of obscure nomenclature like endofunctors and Yoneda Lemma. Something that seemed reserved for the nerdiest programming language theorists, hardcore Haskellers, and near-schizophrenic mathematicians.

Earlier this year, I spent a couple hours watching youtube videos on it just so I could go from 0 (“I have no idea what it is but I have heard the name”) to 0.1 (“I still have no idea what it actually is, but I have a general idea of the main concepts”) and double-check my intuitions. What I found is a very addictive, immensely powerful mental model that applies to countless things both in CS but also in nearly everything else. It’s also fundamentally very fun to think about and do. I feel like mathematicians and computer scientists alike fall into it like a curious-minded kid falls into redstones and minecraft modding.

Around a month ago, I finally decided to commit and jump right in, my interest having been piqued by the first video linked below. Since then, I have accumulated many a talk paper and book and I wanted to have a place to stash it all and so here we are.

You can skip may ahead if you’re only interested in the resources.

Why It Grabbed Me

For me, Category Theory has been one of these things where, once you learn about it, you can literally see it everywhere. Everything starts looking like morphisms between objects and functors between categories. I have found the overwhelming majority of the ideas in it to be truly, deeply intuitive. It’s still a work in progress to have a real sense of how immensely powerful they are, and my definition of the “essence of category theory” is still getting new shades every week.

Overall, it did help me sank in two immensely important things, that were previously only intuitions: the power of abstraction and composition

I have started writing a lot more about abstraction and the expressive powers it enables to try and synthesize my thoughts. There are also some markdown with vague scribbles on composition and how fundamentally important it is. Lately I have been trying to also collect my thoughts on the why and what it is that I truly find attractive and useful a mental model of things about Category Theory and give meaningful examples by looking at the troves of FP concepts that have appeared since the 2010s in non-FP languages like Java, C++, JS, Python and with entire languages like Rust.

There’s lots more to say about how research in that field has poured into FP and then into OOP & imperative languages, how come it is so, and there are many more examples to give around: frontend frameworks, the growth in popularity of declarative languages or even in the complexity of distributed systems (etc…) and how all of these being are either influenced or can be interpreted in category theoretic ways.

However, I am no Gwern, and I intend to move off this bearblog ASAP and to my soon-to-be-ready forever home on the internet.

Resources

Youtube Intros / One-offs

Lectures

Books

  • Category Theory for Programmers - Bartosz Milewski The best introduction book, to accompany or lead the youtube series from Bartosz’ himself linked above. Clear language with lots of analogy and pragmatic programming-oriented approach to examples. Difficulty: 1/3
  • Category Theory for Scientists - David I. Spivak Features the now famous relational database schemas example, it is to me the second nicest book on Category Theory, in that was the most second most easily digestible one and served (and still serves) as a great introduction to it. Difficulty: 1+/3
  • An Introduction to Category Theory - Harold Simmons Accompanied with An Introduction to Category Theory (The Solutions) from the same author, it is a rigorous, format and straight to business introduction to category theory. Difficulty: 2/3

The following books, unlike the ones above, I have either not fully went through or only use to get different verbiage around concepts I am struggling with:

  • Basic Category Theory - Tom Leinster (https://arxiv.org/pdf/1612.09375) Heavy, formal, full of signal. Difficulty: 2+/3
  • Categories for the Working Mathematician - Saunders Mac Lane Also heavy, formal, full of signal. Difficulty: 2+/3

These ones I am eager to get started with and have, in an act of pure greed, already flicked through and read some parts of.

  • An Invitation to Applied Category Theory (Seven Sketches in Compositionality) - Brendan Fong, David I. Spinak
  • Category Theory for Computer Scientists - Benjamin C. Pierce

Random papers

On databases x category theory:

On ML: