Category Theory Illustrated: The Visual Introduction That Finally Makes Sense

⬅️ Back to Tutorials

📖 Read Online (free) · Buy Full Version · GitHub · Patreon


I have tried to learn category theory three times. The first was through a dense textbook that lost me somewhere between the second and third definition. The second was through blog posts that assumed more math than I had. The third was through YouTube lectures that moved too fast and left no room to sit with a concept.

This book is what I needed each of those times.

Category Theory Illustrated by Jencel Panic (Boris Marinov) is a free online book that takes a different approach. It is built around diagrams — lots of them — and the text explains what the diagrams mean rather than the other way around. The author drew every illustration in Inkscape. The book is set in Mell Sans. It is beautiful to look at.

What Makes It Different

Most math textbooks follow the same rhythm: definition, theorem, proof, exercises. This one does not. The author states this explicitly in the introductory chapter. He views mathematics not as a tool for solving problems but as a mode of thinking — a language, an art form, a way of seeing connections. The book is organized around understanding, not problem-solving.

The chapters progress from sets and functions through categories, monoids, orders, and logic, then into functors and natural transformations. Each chapter starts with a concrete example and builds up to the abstraction gradually. There are tasks (the author calls them tasks, not exercises) scattered throughout that ask you to verify something for yourself, but they never feel like homework.

The diagrams use consistent visual language. Objects are drawn as labeled boxes or shapes. Morphisms (functions) are arrows between them. Commuting diagrams — the bread and butter of category theory — are shown with colored paths so you can literally trace the equality with your eyes.

Who Made It

The author’s background is part of what makes the book work. He was interested in math as a kid but bad at calculations, so he assumed it was not for him. He got into programming, discovered functional programming, and found his way to category theory through David Spivak’s “Category Theory for Scientists.” He started drawing diagrams as notes. A few years later, strangers on the internet found those notes and encouraged him to write more.

The book is dedicated to F. William Lawvere (1937-2023), a category theorist who believed that abstract mathematics should be accessible.

It has been praised by Vitaly Kurin, a machine learning research scientist at Isomorphic Labs (DeepMind’s protein-folding spinout), Evan Burchard (author of two O’Reilly books), and Gonzalo Casas, a lecturer at ETH Zurich. One reader said it was “the first time I’ve ever felt like I’m getting category theory.”

What Is Covered

The free web version covers: sets and functions, categories, monoids, orders, logic, types, functors, and natural transformations. The paid version adds more chapters and higher-resolution diagrams.

The “sets” chapter alone is worth reading if you have ever struggled to explain what a function actually is to a junior developer. It covers functional composition, associativity, and isomorphism with such clear diagrams that the concepts feel obvious by the end. There is even a section on why monolithic software design violates the principle of composition — connecting category theory directly to the practice of writing code.

Why This Belongs in /use/tutorials

If you write code, you will encounter category theory eventually. Maybe through functional programming (monads, functors), maybe through type theory, maybe through a colleague who will not stop talking about it. This book is the best on-ramp I have found. It respects your intelligence without assuming you already know the material. It does not skip the hard parts, but it draws them first and explains them second.

I keep a browser tab open to the “Orders” chapter because I still reference the commuting diagrams when I need to think clearly about a type signature. That alone has made the book worth my time.

Crepi il lupo! 🐺