- 离线通读或打印:需要一本排版稳定、带目录和交叉引用的范畴论教材时,直接下 release 里的 PDF,比在博客上按时间顺序翻几十篇强
- 改内容或做衍生版本:想把 Haskell 示例换成自己团队的语言、加批注、抽章节做内部讲义,LaTeX 源码是唯一可行的入口,纯 PDF 做不到
- 复现构建:要确认某份 PDF 对应哪版源码、或想长期归档一份能自己重编的文档,Nix flake 锁定了工具链,比手工装 TeX Live 可重复
- 多语言对照:同一概念想同时看 Haskell 和 Scala 的写法,仓库直接产出分语言版本,省得自己拼
milewski-ctfp-pdf
hmemcpy更新放缓 有专家点评把 Bartosz Milewski 的《程序员范畴论》整理成可下载的 PDF 和 LaTeX 源码,方便离线阅读、打印或自行修改排版。
Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
专家点评
上手难度:进阶更新于 2026-11-11把 Milewski 的范畴论博客固化成可编译的 LaTeX 书稿,替代散落的博客页面和二手扫描 PDF
适用场景
踩坑
- 不装 Nix 就走不通官方流程:README 的构建路径完全绑定 flake,已有 TeX Live 环境的人也得先装 Nix 并开 experimental-features,否则 make 那套要自己摸依赖
- 产物落在 result 目录而不是当前目录,第一次构建容易以为失败了;result 是符号链接,重复构建前要留意旧链接
- issue 里 epub/mobi/html5 和电子墨水设备相关的请求反复出现且反应数最高,说明当前只出 PDF,想在 Kindle 上读得自己转,转换质量仓库不管
同类对比
只想读不想改的话,直接下 release 的 PDF 即可,不必碰这个仓库;要系统性学范畴论且更看重交互式练习,可以看同作者的视频系列或其他教材,但那些不是同一份文本的可编译源。
nix build .#ctfp
nix build .#ctfp-scalaREADME 未说明,构建只依赖 Nix,无 GPU 或显存要求
项目说明
由 README 自动翻译提炼把 Bartosz Milewski 的《程序员范畴论》博客系列转成可下载的 PDF 与 LaTeX 源码
把 Bartosz Milewski 的《程序员范畴论》整理成可下载的 PDF 和 LaTeX 源码,方便离线阅读、打印或自行修改排版。
核心能力
- 提供 Haskell、Scala、OCaml、Reason 等多语言版本的 PDF
- 附带完整 LaTeX 源码与图片,可自行编译修改
- 用 Nix flake 管理构建环境,一条命令产出 PDF
- 支持通过 Makefile 手动构建各版本
容易踩的坑
构建前需手动启用 Nix 的 flake 实验特性;不装 Nix 无法用官方流程构建;编译产物输出在 result 目录而非当前目录
- v36-98b71acVersion 36 (98b71ac)pre-release最新正式版2023-01-30 · 2023-01-30 15:49 UTC
这个版本没有写更新说明。
- v35-d175452Version 35 (d175452)pre-release2023-01-02 · 2023-01-02 19:28 UTC
这个版本没有写更新说明。
- v34-a325ca2Version 34 (a325ca2)pre-release2022-09-19 · 2022-09-19 12:55 UTC
这个版本没有写更新说明。
- v33-143f1a5Version 33 (143f1a5)pre-release2022-09-03 · 2022-09-03 03:54 UTC
这个版本没有写更新说明。
- v32-5706d4cVersion 32 (5706d4c)pre-release2022-05-17 · 2022-05-17 12:07 UTC
这个版本没有写更新说明。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Category Theory For Programmers
An unofficial PDF version of "Category Theory For Programmers" by Bartosz Milewski, converted from his blogpost series (with permission!).

Buy the book
- Standard edition 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 in paperback
- Publish date: 12 August, 2019.
- Based off release tag v1.3.0. See errata-scala for changes and fixes since print.
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.