Buy It Now
If you purchase the eBook, you
will be entitled to receive periodic updates as errata are fixed,
for no additional charge.
If you purchase a paper book, it will be shipped as soon as
it comes into stock.
If you purchase the combo, the paper book will be shipped when
it is published.
About the book
The purpose of this book is to inspire practicing programmers
with mathematical notions that are becoming increasingly relevant to daily coding practice. For example, types can be
viewed as objects in category theory. You need
monoids to apply map/reduce or implement and use efficient data storage structures, like finger tree. You need monads
and a Kleisli category to explain and formalize side effects in your application. A select where clause in SQL is
a categorical construct of a pullback.
The scope of the book is focused on the modern mathematics you need to dive deeply into how computing works.
Much of this material is not included in regular mathematics courses for engineers. Mathematics courses, except
for the version studied by postgrads in the best universities, mostly consist of centuriesold ideas and notions. These
ideas may be good, but the world of ideas in computing is already much further ahead.
This book is not for mathematicians. They should find better sources of information or inspiration, those that are mathematically
strict, contain many theorems and exercises, and are probably targeting a more distant future. For example, there is no
topology in this book, no homotopy, no functional analysis, and no equations. No linear algebra, either. These days, linear
algebra is extremely popular in machine learning, but machine learning is not programming.
Reading this book will help you in your daily programming tasks, because having a sound theory helps you avoid mistakes.
For example, it is well known how to write a parser for a language or data structure. You cannot, for example,
parse HTML with a regular expression, because HTML is context free.
Learning about the ideas presented in this book will give you insights that will
make you a better programmer.

Table of contents
Contents
List of Figures
List of Tables
List of Listings
Acknowledgments
Introduction
1. Functions
2. Abstractions of Algebra
3. Partial Orders, Graphs, and DAGs
4. Boolean Logic
5. NonBoolean Logic
6. Quantifiers
7. Models and Theories
8. Category: MultiTiered Monoid
9. Working with Categories
10. Products and Sums
11. More Constructions in a Category
12. Relations Between Categories
13. Relations Between Functors
14. Cartesian Closed Categories
15. Monads
16. Monads: Algebras and Kleisli
17. Untyped Lambda Calculus
18. Typed Lambda Calculus
19. CurryHowardLambek Correspondence
Answers to Exercises
Conclusion
Glossary
Bibliography
About the Author
Index
About the author
Vlad Patryshev is a software developer living in South Carolina. He was
born in Arkhangelsk, Russia, and spent most of his life in St.Petersburg.
After graduating from St.Petersburg University, he followed his hobby of
writing code. Meanwhile, he was interested in category theory and toposes,
and worked in that area for a while.
In 1998 Vlad and his wife Julia moved to San Francisco Bay Area in
California, and worked in a variety of software companies. Google keyboard
was his project. Vlad was also teaching logic and formal methods at Santa
Clara University between 2013 and 2021, and was an organizer of Scala and
Category Theory meetups. His wife Julia is an artist, working with ceramics,
and taught art at Bay Area colleges.


