Learning Category Theory without a Formal Mathematics Background (pt. 3)


Introduction

It's time to wrap up this little series of posts on learning category theory (although in no sense does that mean that I feel that I've completed my studies). Recall we came from Conceptual Mathematics: A First Introduction to Categories (discussed in pt. 1) and then Category Theory for Computing Science (discussed in pt. 2), after discovering that classic texts like Categories for the Working Mathematician were nigh incomprehensible to someone of my background.

The next step on my journey is Milewski's Category Theory for Programmers, which he graciously makes available for free here.

Category Theory for Programmers

First of all, I must note that I approached this book already having significant exposure to (basic) Haskell, which Milewski uses often in code samples throughout, and there is no doubt that this experience afforded a significant advantage in understanding the text. That said, Milewski does note in the preface that prior familiarity with Haskell is not required, and that basic Haskell concepts would be explained as they are needed (and C++ is used quite often throughout the text as well). If you are considering reading this text, but do not yet know Haskell, this might be a great way to learn. (Really, if you're reading this post, Haskell is probably at least adjacent to your interests in any case.)

With that said, for my specific goal of learning category theory to supplement my studies in Haskell, Category Theory for Programmers is exactly the book I needed. It is hard to overstate the value of having concrete examples, grounded in a familiar field, when trying to understand the abstract concepts. At the same time, I feel the time spent reading the more math-focused texts complements that understanding with an appreciation for the wide applicability of category theory beyond programming.

Category Theory for Programmers touches on a broad collection of topics, starting from the fundamental ones like products, functors, and natural transformations, and then building up to Kleisli categories, monoids, the Yoneda lemma, adjunctions, monads, algebras, Kan extensions, and more. Each concept is tied back to what it looks like in the type system of a programming language, which, again, for someone of my background, was immensely helpful, particularly in the later chapters.

The only other thing I'll say at this point is that the book is filled with incredibly charming diagrams. Really, I can't recommend it highly enough, and I wish I had found it sooner.

Conclusion and Final Recommendation

So where does that leave me? Well, I purchased a copy of Categories for the Working Mathematician, and I've read well into the chapter on adjoints (the fourth chapter) without much trouble. I'd call that a resounding success, given where I was when I started this journey.

To someone in a similar situation, with similar interests, I would say start with Milewski's Category Theory for Programmers for the sake of being time efficient, and then switch to Lawvere and Schanuel's Conceptual Mathematics: A First Introduction to Categories only if additional clarity in the fundamentals is needed.

To someone without a computer science background, I would say definitely start with Lawvere and Schanuel's Conceptual Mathematics: A First Introduction to Categories - it's a fantastic introduction that is accessible even to those who without any exposure to mathematics at the college level. Then, I'd encourage them to dabble a bit in Haskell and the programming side of things and eventually pick up Milewski's Category Theory for Programmers. However, if the programming perspective isn't interesting, perhaps there exist other intermediate texts that serve as a good stepping stone before tackling Mac Lane; I wasn't able to find any, but do let me know if you locate one.