Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
Go to file
aszlig bca9cf5d3d
Switch to using Nix flakes (#253)
Someone has requested me to build this book, since they didn't have Nix.

So when looking at the Nix expressions I found that there was only a
shell.nix and the default.nix was essentially just aliasing the
shell.nix but without the pinning.

However, with Nix flakes we no longer need to do pinning like this and
we instead have a flake.lock file, which essentially pins the
corresponding revisions.

I also added a default.nix, which uses flake-compat to make sure that
nix-shell and nix-build work as before.

Since so far the way to build the PDF(s) was to get into a Nix shell and
run make accordingly. For me however it's unacceptable to build random
code without the Nix sandbox, so while writing a proper default.nix I
decided it would be better to turn it into a Nix flake.

Apart from the previous ways to build this project we now have:

  $ nix develop # To get a Nix shell (similar to nix-shell but cached)
  $ nix build # The default edition
  $ nix build .\#ctfp-scala # The Scala edition
  $ nix build .\#ctfp-ocaml # The OCaml edition

Signed-off-by: aszlig <aszlig@nix.build>
2020-09-04 15:16:42 +03:00
.github/workflows Builds with GitHub actions (#251) 2020-07-21 18:42:44 +03:00
src Switch to using Nix flakes (#253) 2020-09-04 15:16:42 +03:00
.gitignore Removing caches, handling it on CI 2020-02-14 19:21:48 +02:00
.travis.yml Removing caches, handling it on CI 2020-02-14 19:21:48 +02:00
default.nix Switch to using Nix flakes (#253) 2020-09-04 15:16:42 +03:00
errata-1.0.0.md Rename errata.md to errata-1.0.0.md 2019-08-29 22:49:41 +03:00
errata-1.3.0.md Fix typo (#228) 2020-01-11 15:35:46 +02:00
errata-scala.md Change bimap to dimap in scala's Profunctor definition (#243) 2020-02-25 12:17:30 -08:00
flake.lock Switch to using Nix flakes (#253) 2020-09-04 15:16:42 +03:00
flake.nix Switch to using Nix flakes (#253) 2020-09-04 15:16:42 +03:00
LICENSE Updating readme 2017-10-16 21:36:25 +03:00
README.md Removing some info. It's written in the Colophon section of the book 2019-08-29 23:01:03 +03:00

Category Theory for Programmers

image Direct link: category-theory-for-programmers.pdf
(Latest release: v1.3.0, August 2019. See releases for additional formats and languages.)

Build Status
(latest CI build)

Buy Category Theory for Programmers
Available in full-color hardcover print
Publish date: 12 August, 2019. Based off release tag v1.3.0. See errata-1.3.0 for changes and fixes since print.

Scala Edition is now available in paperback
Publish date: 12 August, 2019. Based off release tag v1.3.0. See errata-scala for changes and fixes since print.

This is an unofficial PDF version of "Category Theory for Programmers" by Bartosz Milewski, converted from his blogpost series (with permission!)


Building

The best way to build the book is using the Nix package manager. After installing Nix, type nix-shell in the root directory of the project. This will download all the needed dependencies and tools to build the book (TeXLive, required fonts and packages, Pygments theme for syntax highligting, etc.)

When the download is complete, and you're prompted with a shell, use the instructions below to build the book.

The src directory contains the LaTeX sources. To recompile the book, go there and enter:

$ make

To build the Scala edition, type:

$ make scala

Upon successful compilation, the files will be placed in the out directory next to src.

The file preamble.tex contains all the configuration and style declarations.

Acknowledgements

PDF LaTeX source and the tools to create it are based on the work by Andres Raba et al., available here: https://github.com/sarabander/sicp-pdf.
The book content is taken, with permission, from Bartosz Milewski's blogpost series, and adapted to the LaTeX format.

Thanks to the following people for contributing corrections/conversions and misc:

  • Oleg Rakitskiy
  • Jared Weakly
  • Paolo G. Giarrusso
  • Adi Shavit
  • Mico Loretan
  • Marcello Seri
  • Erwin Maruli Tua Pakpahan
  • Markus Hauck
  • Yevheniy Zelenskyy
  • Ross Kirsling
  • ...and many others!

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

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 (cc by-sa).

The script files scraper.py and others are licensed under GNU General Public License version 3 (for details, see LICENSE).