Bartosz Milewski

bartoszmilewski.com · Personal blog · on HN since 2008

Bartosz Milewski writes about category theory for programmers, functional programming, C++, and concurrency, including a free book.

What HN saysCommenters recommend his category theory material to beginners as mind-opening, and some say it is the best place to learn the subject.
196HN people shared it
118linked it in comments
177stories submitted
4.1Kstory points
4 months agolast shared
2008people per year2026

Most-shared posts

  1. 1
    Category Theory for Programmers (2014)
    71 people · 548 points · first shared 2014 · 63 comments on HN
  2. 2
    Homepage
    10 people · first shared 2012
  3. 3
    Category: The Essence of Composition
    8 people · 78 points · first shared 2014 · discussion on HN
  4. 4
    Who ordered memory fences on an x86? (2008)
    7 people · 158 points · first shared 2012 · 25 comments on HN
  5. 5
    Functorio
    5 people · 307 points · first shared 2021 · 74 comments on HN
  6. 6
    Edward C++Hands
    5 people · 255 points · first shared 2013 · 228 comments on HN
  7. 7
    Kleisli Categories – Composition of Logs
    4 people · 57 points · first shared 2014 · 6 comments on HN
  8. 8
    Functional Data Structures in C++: Lists (2013)
    4 people · 30 points · first shared 2013 · 4 comments on HN
  9. 9
  10. 10
    Math is an insurance policy
    3 people · 215 points · first shared 2020 · 126 comments on HN
  11. 11
    Getting Lazy with C++
    3 people · 85 points · first shared 2014 · 38 comments on HN
  12. 12
    Identity Types
    3 people · 67 points · first shared 2025 · 41 comments on HN
  13. 13
    Monads in C++
    3 people · 30 points · first shared 2012 · 1 comments on HN
  14. 14
  15. 15
    Understanding Yoneda (2013)
    3 people · 22 points · first shared 2013 · discussion on HN

What HN people wrote when they linked it

mkw5053 · 2026-07-14
He also has an excellent online/PDF version of the material[0]. All of it is really mind opening stuff, and fun! [0] https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
jhartikainen · 2026-07-04
Not sure of your level, but as a beginner, these two were recommended to me on HN previously: - https://www.cambridge.org/highereducation/books/conceptual-mathematics… - https://bartoszmilewski.com/2014/11/04/category-the-essence-of-composi… (a blog series on CT specifically for programmers)
AdieuToLogic · 2025-08-20
Great point. The technique of currying method parameters such that the last one is the input to the operation also makes chaining Kleislis[0] quite nice, albeit using a bind operator (such as `>>=`) instead of the Thrush combinator operator (`|>`). 0 - https://bartoszmilewski.com/2014/12/23/kleisli-categories/
Krei-se · 2024-10-25
This is such a great page, i love it and came across it multiple times while studying the matter. I still would vote to learn it from Milewski though. Learning this is a journey and the author of ct-illustrated is, i think, still in the middle of it. Milewski has made that trip multiple times already. The book and his blog are great places. https://github.com/hmemcpy/milewski-ctfp-pdf Book https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… Blog
snakey · 2023-04-24
I too am a beginner with concurrent programming—it's a difficult topic to get your head around at first. Some resources that I've found super helpful: - Dmitry Vyukov's Lockless Algorithms: https://www.1024cores.net/home/lock-free-algorithms - Jeff Preshing's blog (worth exploring all adjacent articles): https://preshing.com/20120612/an-introduction-to-lock-free-programming… - Bartosz Milewski: https://bartoszmilewski.com/2008/12/01/c-atomics-and-memory-ordering/ - Memory Barriers: a Hardware View for Software Hackers—P.McKenney: https://www.researchgate.net/publication/228824849_Memory_Barriers_a_H… I hope you find some of these useful. I've re-read Paul McKenney's paper every 2-3 months in an attempt to get this stuff to stick! :)
Sharlin · 2022-10-07
See also the great, nerd-friendly blog series "Guitar Decomposed" by Bartosz Milewski[1]. Yes, the same guy who wrote Category Theory for Programmers. [1] https://bartoszmilewski.com/2020/05/24/guitar-decomposed-1-weird-logic…
nh23423fefe · 2022-05-24
also the classic category theory for programmers https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
evandale · 2022-05-24
It may be this book: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… If not, I recommend reading it.
nafizh · 2021-09-26
Category theory for programmers by Bartosz Milewski [0] is another great resource geared more towards how programmers can leverage it in their work. 0. https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
envp · 2021-09-16
Definitely recommend CTFP: (Category Theory For Programmers) https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
create_comment · 2021-08-26
The following frames Cantor's argument in a more computational way, maybe it is of use: https://bartoszmilewski.com/2019/11/06/fixed-points-and-diagonal-argum… Some of the references found in the above make for interesting reading as well.
turndown · 2021-07-12
axelroze · 2021-06-25
Category theory for programmers is also a great read if one is into FP. [1] https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
benrbray · 2021-06-25
Riehl's "Category Theory in Context" is great. It's one of those books where every page really takes a couple hours to fully absorb. It pairs well with Milewski's "Category Theory for Programmers" [1] series, which is comparatively lighter and gives some concrete examples. [1] https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
ajarmst · 2021-04-01
For non-mathematicians (although some post-secondary maths is probably required), I'd also recommend Spivak's "Category Theory for the Sciences" (MIT Press, 2014) and Milewski's "Category Theory for Programmers" (available online at https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… I liked it enough to buy the hardcover.
ABeeSea · 2021-02-09
Coming from a math background, once I had the syntax sorted and could write a few simple file parsers in Haskell, “Category theory for programmers” helped me understand some of what the Haskell type system is trying to accomplish. (Endofunctors of the category of Haskell types). I didn’t and still don’t understand the template C++ in the book but still my favorite Haskell resource. Many of the examples are written in both Haskell and C++. Caveat: I just started learning this last year. https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
eru · 2020-09-25
Yes, that was what I was going for. For what it's worth, https://bartoszmilewski.com/2015/09/01/the-yoneda-lemma/ does a pretty good job of explaining the Yoneda lemma in a programming context. Look for the section "Yoneda in Haskell". As I also tried to say earlier, in practice I suggest learning programming first, and then using the likes of category theory to organise your understanding.
cole-k · 2020-09-24
Unlike the other comments so far, I have a link that is in my opinion NOT generally useful for most programmers. I figured it is worth a share for the programmer who knows all of the math in this post and wants to learn yet more: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… Other people can debate category theory's utility: I have no expert insight of my own to lend.
philzook · 2020-05-03
From a programming persepctive, I could recommend Bartosz Milewski's series https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… RydeHeard and Burstall - http://www.cs.man.ac.uk/~david/categories/book/book.pdf Milewski, Fong, and Spivak's course - http://brendanfong.com/programmingcats.html From a mathematical perspective: MacLane, Awodey's book, Conceptual Mathematics by Lawvere and Schanuel.
eindiran · 2020-02-24
In case anyone is interested, the author also wrote the excellent "Category Theory for Programmers", available in print or online: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… If you're interested in what Category Theory is about, it's a great place to start for people with a background in programming but not necessarily mathematics.
bojo · 2018-10-22
For anyone that may want a deeper look into Category Theory from the perspective of a programmer I highly recommend - https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… He also covers it all in few youtube series - https://www.youtube.com/user/DrBartosz/playlists
dogruck · 2017-11-07
Yes. Although I question the usefulness of this jargon list, I think Bartosz Milewski’s CTfP is excellent: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
maremmano · 2017-09-02
I really appreciate the work of Bartosz Milewski: https://bartoszmilewski.com/
leshow · 2017-01-30
Most guys I follow are either rust or haskell developers. @manishearth - rust - https://manishearth.github.io/ @bitemyapp - writer of haskell: first principles @bartoszmilewski - haskell - https://bartoszmilewski.com/ @jdegoes - writes informative FP blog posts - http://degoes.net/ @aaron_turon - rust - https://aturon.github.io/blog/ @pcwalton - rust @nikomatsakis - rust - http://smallcultfollowing.com/babysteps/ @paf31 - purescript creator @nick_r_cameron - rust @kmett - famous haskeller @steveklabnik - rust - http://words.steveklabnik.com/
openfuture · 2017-01-21
That just means you are missing some foundation. If you are interested in understanding the theory I really recommend this: https://www.youtube.com/watch?v=I8LbkfSSR58 https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…
PudgePacket · 2016-12-26
I'm going through this series aimed at programmers by Bartosz Milewski, finding it pretty great so far. https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers… https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2Hsnaw…
tempodox · 2016-09-30
Look around https://bartoszmilewski.com Has articles about Category Theory, Monads, etc... for beginners.
buddhu · 2016-08-07
"Category Theory for Programmers" is generally excellent and quite easy to read: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close