Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Category Theory for Programmers

    Category Theory for Programmers

    Bortosz Milewski, Bartosz Milewski · 2018

    Category Theory is one of the most abstract branches of mathematics. It is usually taught to graduate students after they have mastered several other branches of mathematics, like algebra, topology, and group theory. It might therefore come as a shock that the basic concepts of category theory can be explained in relatively simple terms to anybody with some experience in programming.That's because, just like programming, category theory is about structure. Mathematicians discover structure in mathematical theories, programmers discover structure in computer programs. Well structured programs are easier to understand and maintain, and are less likely to contain bugs. Category theory provides the language to talk about structure, and learning it will make you a better programmer.

    Mathematics
    Open LibraryAmazon
    Stats for nerds
    51recommend
    90mentions
    78people
    2015–2026years
    62% recommend32% neutral6% critical

    Mentions per year

    2015201720192021202320252026

    What Hacker News says

    1. lioetersJul 2026
      In a different comment thread, someone mentioned the book, Category Theory for Programmers. Here's the Releases page with PDF files (click to open the Assets section). https://github.com/hmemcpy/milewski-ctfp-pdf/releases

      There are several versions with code examples in Haskell, OCaml, ReasonML, and Scala. These are all typically associated with functional programming and category theory. However, category theory is a much wider and deeper subject than any specific language, and deals with mathematical objects and concepts relevant to (more or less) all of programming.

      thread
    2. seanhunterMay 2026
      He has also done a youtube series on category theory for programmers [1]. I have personally been using a book recommended by someone here called "Conceptual Mathematics"[2] and have been finding it great so far in the sense that it only relies on high-school level maths concepts while introducing the categorical concepts in contexts where you can see the value of the approach [3].

      It is really an interesting set of ideas and as soon as you start using it, some things start to change in how you approach problems. Just today in fact I was working on something and thought to myself "I need the opposite of a forgetful functor - I wonder what that is?" (turns out it's the "free group functor"). But because I knew about the existence of the concept it helped turn what would otherwise have been a maths problem that I would have really struggled with into something that was conceptually easy for me to deal with. I essentially could use the category theory to turn a problem that was hard to think about into something easy to think about (and also to show that this was valid) and then I could solve the problem in a conventional way.

      [1] https://www.youtube.com/watch?v=I8LbkfSSR58&list=PLbgaMIhjbm...

      [2] https://www.cambridge.org/highereducation/books/conceptual-m...

      [3] As opposed to say Emily Riehl's "Category Theory in Context" https://math.jhu.edu/~eriehl/161/context.pdf where the maths required to even get started with the examples in the intro is graduate level. To get a sense, this is literally the first sentence of the first chapter: "A group extension of an abelian group H by an abelian group G consists of a group E together with an inclusion of G ↪→ E as a normal subgroup and a surjective homomorphism E ->> H that displays H as the quotient group E/G. " It's pretty full on.

      thread
    3. hyperbrainerApr 2025
      If you wish to approach Category Theory from the viewpoint of a programmer, not a mathematician, I suggest Bartosz Milewski's book Category Theory for Programmers. For this, all you need is some previous programming experience. He uses C++ and Haskell iirc but as long as you can read snippets of code, you'll be fine.

      I am suggesting this since you said you want to better understand functional programming. Category Theory, as mathematicians look at it, is an extremely abstract field. If you want to do pure math related stuff in Category Theory, and only then, I would say important prereqs are Abstract Algebra and Topology. I believe the motivation for Category theory lies in Algebraic Geometry and Algebraic Topology, but you definitely don't need to be an expert on these to learn it.

      thread
    4. codethiefJul 2024
      I recently started reading Bartosz Milewski's Category Theory for Programmers[0] and while it's less about Haskell per se and more about the ideas behind it, I found it did a much better job at explaining Haskell to me than any other introduction I read before. At least I'm able to appreciate Typing the Technical Interview[1] now. :-)

      [0]: https://github.com/hmemcpy/milewski-ctfp-pdf

      [1]: https://aphyr.com/posts/342-typing-the-technical-interview

      thread
    5. zzhelezcJun 2024
      These might be useful - Programming With Categories [1] and Category Theory for Programmers [2] (also on YT [3]).

      [1] http://brendanfong.com/programmingcats.html

      [2] https://bartoszmilewski.com/2014/10/28/category-theory-for-p...

      [3] https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI...

      thread
    6. numeromancerMay 2024
      The Abolition of Man - C. S. Lewis

      All Things Considered - G. K. Chesterton

      Some others I daren't mention.

      Category Theory for Programmers - Bartosz Milewski

      The Design of Relational Databases - Heikki Mannila, Kari-Jouko Raiha

      thread

    Related

    Category Theory in ContextEmily Riehl
    2017–2026

    Category Theory in Context

    Emily Riehl
    8 recommend · 17
    Cover of Basic category theory for computer scientists
    2008–2025

    Basic category theory for computer scientists

    Benjamin C. Pierce
    12 recommend · 16
    Cover of Basic Category Theory
    2014–2026

    Basic Category Theory

    Tom Leinster
    7 recommend · 10
    Cover of Conceptual Mathematics
    2009–2026

    Conceptual Mathematics

    F. William Lawvere
    36 recommend · 61
    Cover of Invitation to Applied Category Theory
    2019–2022

    Invitation to Applied Category Theory

    Brendan Fong
    8 recommend · 15
    Cover of Category theory
    2013–2021

    Category theory

    Steve Awodey
    7 recommend · 9
    Cover of Category theory for computing science
    2010–2025

    Category theory for computing science

    Michael Barr
    5 recommend · 7
    Programming Algorithms in LispVsevolod Domkin
    2021–2022

    Programming Algorithms in Lisp

    Vsevolod Domkin
    1 recommend · 4