Back to rankings

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source

haskellcategory-theoryfunctional-programmingpdflatexcppscalaocaml
Star Growth
Stars
11.7k
Forks
645
Weekly Growth
Issues
44
5k10k
Jan 2023Mar 2024May 2025Jul 2026
README

GitHub stars GitHub Workflow Status Download License

Category Theory For Programmers

An unofficial PDF version of "Category Theory For Programmers" by Bartosz Milewski, converted from his blogpost series (with permission!).

Category Theory for Programmers

Buy the book

Build the book

The building workflow requires Nix. After installing Nix, you need to enable the upcoming "flake" feature which must be enabled manually the time being. This is needed to expose the new Nix commands and flakes support that are hidden behind feature-flags.

Afterwards, type nix flake show in the root directory of the project to see all the available versions of this book. Then type nix build .#<edition> to build the edition you want (Scala, OCaml, Reason and their printed versions). For example, to build the Scala edition you'll have to type nix build .#ctfp-scala. For Haskell (the original version) that is just nix build .#ctfp.

Upon successful compilation, the PDF file will be placed in the result directory.

The command nix develop will provide a shell containing all the required dependencies to build the book manually using the provided Makefile. To build the ctfp-scala edition, just run make ctfp-scala.

Contribute

Contributors are welcome to contribute to this book by sending pull-requests. Once reviewed, the changes are merged in the main branch and will be incorporated in the next release.

Note from Bartosz: I really appreciate all your contributions. You made this book much better than I could have imagined. Thank you!

Find the list of contributors on Github.

Acknowledgements

PDF LaTeX source and the tools to create it are based on the work by Andres Raba. The book content is taken, with permission, from Bartosz Milewski's blogpost series, and adapted to the LaTeX format.

The original blog post acknowledgments by Bartosz are consolidated in the Acknowledgments page at the end of the book.

License

The PDF book, .tex files, and associated images and figures in directories src/fig and src/content are licensed under Creative Commons Attribution-ShareAlike 4.0 International License.

The script files scraper.py and others are licensed under GNU General Public License version 3.

Related repositories
jgm/pandoc

Universal markup converter

HaskellGNU General Public License v2.0pandochaskell
pandoc.org
45.5k3.9k
koalaman/shellcheck

ShellCheck, a static analysis tool for shell scripts

HaskellGNU General Public License v3.0haskellshell
shellcheck.net
39.7k1.9k
hasura/graphql-engine

Blazing fast, instant realtime GraphQL APIs on all your data with fine grained access control, also trigger webhooks on database events.

TypeScriptnpmApache License 2.0graphqlgraphql-server
hasura.io
32k2.9k
PostgREST/postgrest

REST API for any Postgres database

HaskellMIT Licensehaskelldatabase
postgrest.org
27.5k1.2k
compiler-explorer/compiler-explorer

Run compilers interactively from your web browser and interact with the assembly

TypeScriptnpmBSD 2-Clause "Simplified" Licenserustc-plus-plus
godbolt.org
18.9k2.1k
simplex-chat/simplex-chat

SimpleX - the first messaging network operating without user identifiers of any kind - 100% private by design! iOS, Android and desktop apps 📱!

HaskellGNU Affero General Public License v3.0chatprotocol
simplex.chat
18.8k1.2k
hadolint/hadolint

Dockerfile linter, validate inline bash, written in Haskell

HaskellGNU General Public License v3.0dockerfilelinter
12.3k498
lk-geimfari/awesomo

Cool open source projects. Choose your project and get involved in Open Source development now.

GoGo ModulesCreative Commons Zero v1.0 Universalawesomeocaml
9.9k689
purescript/purescript

A strongly-typed language that compiles to JavaScript

HaskellOtherhaskellpurescript
purescript.org
8.9k571
unisonweb/unison

A friendly programming language from the future

HaskellOtherhaskellprogramming-language
unison-lang.org
6.7k305
liuxinyu95/AlgoXY

Book of Elementary Functional Algorithms and Data structures

TeXalgorithmshaskell
6.3k764
extism/extism

The framework for building with WebAssembly (wasm). Easily & securely load wasm modules, move data, call functions, and build extensible apps.

Rustcrates.ioBSD 3-Clause "New" or "Revised" Licenseplugin-systemc
extism.org
5.7k165