Category Theory is one of the most abstract branches of mathematics. It is usually taught to graduate students after they have mastered several other branches of mathematics, like algebra, topology, and group theory. It might, therefore, come as a shock that the basic concepts of category theory can be explained in relatively simple terms to anybody with some experience in programming.
That's because, just like programming, category theory is about structure. Mathematicians discover structure in mathematical theories, programmers discover structure in computer programs. Well-structured programs are easier to understand and maintain and are less likely to contain bugs. Category theory provides the language to talk about structure and learning it will make you a better programmer.
This open book is licensed under a Creative Commons License (CC BY-SA). You can download Category Theory for Programmers ebook for free in PDF format (16.3 MB).
Table of Contents
Category: The Essence of Composition
Types and Functions
Categories Great and Small
Products and Coproducts
Simple Algebraic Data Types
Limits and Colimits
The Yoneda Lemma
It's All About Morphisms
Monads: Programmer's Definition
Monads and Effects
Algebras for Monads
Ends and Coends
Monads, Monoids, and Categories