Category Theory Illustrated

(abuseofnotation.github.io)

191 points | by signa11 353 days ago

17 comments

  • civilized 350 days ago
    I'm a sympathetic mathematician but I found this whole passage bizarrely off-base:

    > mathematics is in a weird and, I’d say, unique position of always having to defend what they do with respect to it’s value for other disciplines. I again stress that this is something that would be considered absurd when it comes to any other discipline.

    > People don’t expect any return on investment from physical theories - noone bashed string theory for failing to make useful predictions.

    Huh? Tons of people bash string theory for failing to make useful predictions! There was a whole book criticizing it called "Not Even Wrong", meaning it didn't even reach the point of being testable.

    A better argument for advanced math: it's not always clear in advance what math will be useful. A popular example is Riemannian geometry, which had no clear real-world value when developed, but ended up being used for General Relativity a few decades later.

    I also support the argument that math is intrinsically and aesthetically valuable, but for those who don't agree, the argument above may make some headway.

    • cubefox 350 days ago
      > A better argument for advanced math: it's not always clear in advance what math will be useful. A popular example is Riemannian geometry, which had no clear real-world value when developed, but ended up being used for General Relativity a few decades later.

      This is the classical argument, but I don't think it is plausible. It seems even less likely that, say, transfinite set theory will ever become remotely useful than string theory ever becoming useful.

      The argument "it might be useful in the future" can justify research in any theory whatsoever, no matter how esoteric. It's like defending an outlandish conspiracy theory by pointing out that it is possible that it is true. That's technicality correct, but what matters here is the probability that it is true, which might well be close to zero. Similarly, while we can't rule out that transfinite set theory might have a useful application someday, this probability is so small as to not being worth discussing.

      I think people should admit that they are interested in theoretical math (as opposed to applied math) for its own sake, like people who are interested in cosmology or string theory or theoretical philosophy or whatnot. Pointing to the technical possibility of future usefulness seems to be a dishonest fig leaf.

      • civilized 350 days ago
        Actually, no, there are results from transfinite set theory which are foundational to so much mathematics that there would be extensive damage to the theoretical foundations of very practical math if it were unavailable.

        For example, the distinction between countable and uncountable is important in analysis and measure theory. Countable subsets of the real line have Lebesgue measure zero, and this result is used in many theorems in probability and stochastic process theory with practical implications.

        Now that we've seen a statement which was rated as almost certain is incorrect, it seems to reinforce my original point: it is not so clear what kind of math has applications, so it is good to develop math broadly.

        I agree that it shouldn't be our only argument, but it does pack a significant punch.

        • cubefox 350 days ago
          Most mathematicians never use ZFC or any similar "foundational" system. That something can serve as such a foundation doesn't remotely mean that it is useful. Math is not like a house which breaks down without a foundation.

          The distinction between countable and unaccountable infinity is precisely something that finitists point out as being useless. For example, analysis existed well before Cantor, and it's notion of limits and convergence ironically provides a potential notion of infinity which doesn't treat it as a mathematical object, contrary to the set theoretical notion of actual infinity, where we have a zoo of transfinite numbers.

          And the fact that the countable/uncountable distinction can be integrated in some practical theories doesn't show that it has any practical implication. That would only be the case if those practical theories wouldn't exist otherwise. But analysis existed before Cantor, and other practical theories, like probability theory, could have existed before him. They are perfectly compatible with being a finitist.

          • practal 350 days ago
            If we are talking about "most" mathematicians, then you should also admit that most mathematicians are not a member of the finitist church, and that most mathematicians appreciate the distinction between countable and uncountable.
            • civilized 350 days ago
              Yeah, I'm not sure I follow the logic of "transfinite set theory isn't useful because any applications it has could be replaced with finitist math", when this is something that no one wants to do.

              Reminds me of that famous old HN comment about how Dropbox is pointless because an equivalent service could be set up with Linux utilities. Sure, but there are reasons people don't want to do that. Most people prefer the ease of use of mainstream foundations.

              To be fair to the original commenter, I would be willing to bet some money that, say, large cardinal theory won't inspire any applications in the next 20 years. But next 100 years or 1000 years, I wouldn't. Maybe there will be some weird cross-fertilization with other more applied fields that leads to something.

              • cubefox 350 days ago
                "transfinite set theory isn't useful because any applications it has could be replaced with finitist math" would be a misleading way to phrase it. Like, analysis is not an "application" of transfinite set theory. It doesn't presuppose the existence of any transfinite numbers. No piece of applied math does. There is nothing which needs to be replaced with "finitist math".
                • civilized 350 days ago
                  To repeat my earlier comment: analysis on mainstream foundations uses infinite sets of multiple transfinite cardinalities, and there are results like "countable sets have Lebesgue measure zero", and the difference between finite, countable, and uncountable sums/unions/intersections, that are relevant to proving results that have practical significance, as well as (crucially) to avoiding erroneous calculations.

                  If you want to prove the same results in a finitist framework, there is nontrivial work to do, and few mathematicians are interested in doing it.

                  If your contention is that only calculations matter, not proofs, I would agree with you that transfinite set theory may not be relevant. You can do calculations without any rigor at all. But I think the position that proofs are of no practical value is untenable. It is historically simply not the case that engineer or physicist intuition is a sufficient guide to deriving results reliably.

                  • cubefox 350 days ago
                    I'm actually interested in what these results of practical significance would be. Practical, as in actually useful for technology or such.

                    I'm also not sure what you mean with "finitist framework". As I said, analysis existed before set theory, it doesn't require any special framework. In fact, the system of natural numbers, real numbers, and complex numbers can be axiomatized just with second-order logic. Without set theory, let alone a transfinite set theory like ZFC. And normal mathematicians wouldn't even use a formal logic here, they would just write down those axioms in plain English.

                    • civilized 350 days ago
                      Hmm. Measure theory without sets? The entire thing is about mapping sets to numbers?

                      Most mathematicians would include measure theory in analysis since it is needed for Lebesgue integration, and what is analysis about if not integrals?

                      If you're wondering about applications of measure theory you'll see plenty here: https://en.m.wikipedia.org/wiki/Measure_(mathematics)

                  • alexvoda 350 days ago
                    I do believe we are getting sidetracked by the example. The original argument was that some fields are studied for their own sake. And that is a good thing.

                    Pretending that the reason to study them is that they may prove useful in some undetermined future is just a distraction used to convince others, usually in order to provide funding or as a means to gain status. We should simply embrace that things are worth studying for the sake of knowledge itself instead of letting the pursuit of knowledge be corrupted by all devouring capitalism which reduces everything to a monetary value by denying the existence of any other kind of value.

            • cubefox 350 days ago
              That was not the issue here though. Whether one is finitist or a Cantorian or agnostic doesn't play a role in applied math precisely because applied math doesn't require any transfinite set theory.
              • practal 350 days ago
                If your issue is that applied math doesn't need infinite sets, then you are just plain wrong. Applied math uses infinite sets, and real numbers, and measure theory, etc. all the time. Granted, what set theorists are interested in most of the time, isn't particularly relevant for applied math. Except of course in the sense that if you one day have a question about your (applied) math which has to do with sets, it is nice that there are people who might have an answer for your question. I've had various such questions when working on Practal.
      • cma 350 days ago
        > The argument "it might be useful in the future" can justify research in any theory whatsoever, no matter how esoteric. It's like defending an outlandish conspiracy theory by pointing out that it is possible that it is true.

        Have you read Against Method? It goes even further.

        https://en.wikipedia.org/wiki/Against_Method

      • posix86 350 days ago
        Researchers at universities only have to justify their work in very broad strokes when it comes to mathematics, if at all.

        It's true that most researchers are motivated like you say, because they like it, because if you do it due to utility, you'll have a hard time. But, the research money that was released to the researchers was justified that it might (and probably will) become useful one day. It has paid off many times in the past.

        • cubefox 350 days ago
          I'm not sure work in theoretical math has really often turned out to be useful. There are some examples, but it seems likely that Einstein & Co would otherwise have simply come up with concepts from Riemannian geometry themselves, ad hoc, as the need arose. There are in fact several cases where useful math (such as integration) has been reinvented multiple times by scientists who were unaware that it already existed. I think the people who do theoretical mathematics don't even believe themselves in practical applications of their research, they just mention this possibility because it sounds good in their grant applications.

          This reminds me of a logician who is interested in non-classical logic, and then writes in his research proposal that it might have applications for AI. Of course this would be GOFAI, which doesn't work, but the guys reviewing the grant application wouldn't know. Or a historian who is interested in neolithic culture in India, and now has to justify how this research could be useful. He probably could write something far-fetched, but the truth is that it very probably won't be useful. Which doesn't mean that it isn't of intrinsic interest.

    • hermitcrab 350 days ago
      >noone bashed string theory for failing to make useful predictions

      That stuck out for me. Lots of people have criticized string theory for exactly that reason. A theory that makes not testable predictions is not a scientific theory.

      Mathematics doesn't have to have real word applications. But science has to make predictions that can be tested experimentally.

    • analog31 350 days ago
      Just to quibble a little bit, but the entire effort of string theory (et al) was to find a testable theory. It's not that they weren't interested in useful predictions, but just that they didn't find any. It wasn't that they weren't making the effort, but that the effort has so far failed.

      But the day is young, as they say. It took humanity 1000 years to figure out how to solve quadratic equations. Physics theory has had a lot of quick successes, but you still never know when the next one will arrive. We might figure it out in a year, or a decade, or a century, or we might never figure it out.

    • boris_m 349 days ago
      Will probably edit it, as many people complained. The focus here is useful predictions, in the sense of predictions that have utilitarian value, but string theory doesn't make any predictions at all, which is another issue altogether.
      • civilized 349 days ago
        Are you sure about that? How much have you researched string theory?

        See for example https://profmattstrassler.com/2022/03/20/a-prediction-from-s...

        Search for SUEP to cut to the chase.

        That aside, thank you for putting this out there. You're explaining advanced math and that's awesome. This is just a quibble about the intro. I'm checking out the rest now (I was only ever a brief and superficial user of category theory). I think I have already learned some things and been refreshed on others!

    • tylerhannan 350 days ago
      Even in the late 90s when I was studying Topology there was a bit of furor over the lack of application...

      Until, suddenly, it was quite applicable in evolutionary biology and knot theory in context of D?NA enzymes.

    • canjobear 350 days ago
      When I think of string theory, the first thing that pops into my head is "mathematically sophisticated theory that sucked in a generation of physicists but is dead now because it doesn't make any testable predictions".
      • civilized 350 days ago
        But some of the fancy math in this area is turning out to be helpful for QFT calculations, and it's becoming clear that we need more powerful math to even formulate proper quantum field theories. Check this article out for a briefing: https://www.quantamagazine.org/the-mystery-at-the-heart-of-p...
        • hermitcrab 350 days ago
          Not sure that is much of a return on investment for the millions (?) of person-years of research that was spent on string theory.
          • civilized 350 days ago
            Compared to what? Civilization spends on a lot of speculative stuff. Venture capital is the art of investing in failures 999 times out of 1000. And personally I'd rather have tens of billions spent on speculative theory research than on, say, Meta's VR boondoggle.
            • hermitcrab 350 days ago
              >I'd rather have tens of billions spent on speculative theory research than on, say, Meta's VR boondoggle.

              We can certainly agree on that!

              • alexvoda 350 days ago
                I believe the lesson here is not that we shouldn't invest in speculative theory research. It's that we need more breadth, we need to not get stuck researching only one option.
          • FridgeSeal 350 days ago
            I for one would much rather seen millions of person-years spent on plumbing the depths of various bits of theory, than have that same energy directed towards making ads/social-media/consumerism better. Not exactly the same “circles”, but the point still stands.
      • layer8 350 days ago
        String theory continues to be the leading candidate for quantum gravity. Very far from dead.
      • daxfohl 350 days ago
        Dead?
  • timmg 350 days ago
    Working as a SWE for lots of years, I've worked with people that always feel the need to "add a level of abstraction" or "build a framework" for (and out of) everything. A lot of the time it doesn't make things better (and often makes things worse).

    Every time I try to learn about Category Theory, I get to a certain point and just start wondering "why?"

    I can't tell if I'm not smart enough to get it (I think that's the most likely answer). But it feels like some math people -- who have nothing better to do -- are just trying to create another level of abstraction.

    Are there things that Category Theory does that other branches couldn't already do? I'm curious to hear other takes on this.

    • maxiepoo 350 days ago
      It sounds like category theory likely has no direct impact on your life. So you can move on.

      But please do not let this bleed into a criticism of category theory as used in mathematics. Category theory from the very beginning was developed to help manage the complexity of modern mathematical fields like algebraic topology. It was then famously used by Grothendieck in algebraic geometry where some of the basic notions (schemes) were defined in terms of category theoretic concepts (functors). It's been applied to many other fields, since, including yes computer science, and mainly for the same purpose: giving precise terminology to common patterns (monads functors etc) and giving us the right concepts to design new functional programming languages. As someone who is an expert on these topics I find some of the popular sentiments about programmers using category theory to be a bit silly, but I'll admit it's overall probably good for my field because it cultivates a lot of interest in students. It probably plays a similar role to pop science/math in other fields: not very deep but fun and can be a gateway to "the real thing".

      The popular perception of category theory is a bit bizarre to me though. It is a beautiful theory with many useful results. But you don't see the same excitement or resentment towards fields like order theory or abstract algebra, which are very closely related to, and just as abstract as, category theory and are used in similar ways.

      • khazhoux 350 days ago
        > It sounds like category theory likely has no direct impact on your life. So you can move on.

        Very dismissive statement that misses the person's point.

        > It is a beautiful theory with many useful results.

        But what are those results? Besides Yoneda, are there insightful, surprising, delightful results? I personally gave up on my CT study after seeing that it was just chapter after chapter of definitions and nothing else.

        I always compare it to abstract algebra. AA can be studied without any connection whatsoever to the physical world or even to numbers -- as "abstract" as math can get. And yet from the first chapter you are hit with surprising theorems, and they continue non-stop, challenging your brain at every turn. I fail to see this in CT.

        • jiggawatts 350 days ago
          This is what turned me off also. Category theory is all promises of potential benefits, but none seem to have materialised.

          The closest example to something useful I’ve seen is a CT-based explanation for why Automatic Differentiation is formulated the way it is.

          However, AD was invented before CT, and the explanation didn’t add any value that I could see. It didn’t result in a “better” AD, it simply attached esoteric labels to existing things.

        • sleepyams 350 days ago
          One interesting result which you may find interesting: https://ncatlab.org/nlab/show/Lawvere's+fixed+point+theorem

          I also highly recommend this survey paper by John Baez and Mike Stay: https://math.ucr.edu/home/baez/rosetta.pdf

          There are plenty of interesting results in category theory, in fact your comparison to abstract algebra is apt. There is only so much you can say about an arbitrary group in general, or an arbitrary topological space, just like there is only so much you can say about an arbitrary category.

        • Twisol 350 days ago
          > Very dismissive statement that misses the person's point.

          I read it as acknowledging that you shouldn't feel like you have to spend time on things that provide you no value. That seems to directly acknowledge the point I took from the earlier comment, which is that they keep spending time on it and coming away with no idea what they even should be getting from it, much less getting anything specifically.

          (I like category theory, but it's a reasonable reaction for most people. I'd love for more people to engage with it on its merits, but also, people have finite time and may rather spend it on things they derive joy from.)

        • maxiepoo 349 days ago
          Basic results that are useful on a day-to-day basis: 1. Yoneda's Lemma, and the corollary that objects defined by universal property are unique up to unique isomorphism 2. Right adjoints preserve limits and more generally, Kan extensions

          The "big" theorem of basic category theory is probably the adjoint functor theorems which, once you realize that so many constructions in math are adjoint functors, gives very useful technical conditions to construct such an adjoint (ctrl-s for "applications" here for examples: https://math.stackexchange.com/questions/844131/adjoint-func...).

          The most delightful surprising results to me come from categorical logic because that is what I am most familiar with. Here is one: any elementary topos is a model of intuitionistic higher-order logic, and also extensional dependent type theory. This vastly expands the domain of applications of logic if you are used to thinking only in terms of set-theoretic models. It also gives us applications of constructivism that are entirely independent from any philosophical debate about the nature of truth. This means that you can take many mathematical fields such as differential geometry, algebraic geometry, topology, as embodied in some category C, embed them into a sheaf topos and then use intuitionistic logic to do constructions and theorems in this area that are vastly simpler than the usual formulations. For instance you can do this with differential geometry and get an intuitionistic logic where you can work explicitly with infinitesimal numbers to calculate derivatives in a completely rigorous fashion. Ingo Blechschmidt has written some expository material in this vein (his main work being in using this in algebraic geometry): https://arxiv.org/abs/2204.00948

          On the "surprising" side, I think the most surprising things for me where seeing how existing mathematical structures were examples of generalized categories: metric spaces are a kind of enriched category and topological spaces are generalized multicategories for the ultrafilter monad.

      • dimitrios1 350 days ago
        What is your recommendation for learning? I've been recommended Bartosz Milewski enough times, and started to dive in. I am not interested in learning the totality of Category theory, just enough to be more effective in FP languages like Haskell.
        • deterministic 350 days ago
          Category Theory will not make you more efficient in FP languages like Haskell. I studied it enough to realise that it doesn’t give me any insights or thinking tools I can actually use to write better software. However I highly recommend reading “Software Foundations”. It is almost guaranteed to make you better at writing software in any language. Including Haskell. That’s what happened to me.
        • cfiggers 350 days ago
          Have you been recommended his blog series/book only, or the playlists on YouTube as well? I really like his recorded lectures on YouTube and they cover similar ground in a similar order to the blog posts (from what I've read—I'm further into the YouTube series than I am his written material).
        • trenchgun 350 days ago
          You don't need to learn category theory to be more effective in FP languages like Haskell. Category theory was used as inspiration for design of ML and Haskell, but it is not necessary for programming in them.
      • travisjungroth 350 days ago
        Weirdly, I don’t love or hate category theory but I get very excited about order theory and abstract algebra in software. It feels lonely exploring them compared to other things, which is funny to say. It’s not fully explored or the new hotness.
        • boris_m 350 days ago
          Category theory is order theory and abstract algebra.
          • travisjungroth 348 days ago
            It’s not like they’re synonyms. There’s overlap and maybe even category theory is a superset. But the experience of working with them is different.
      • HervalFreire 350 days ago
        It's because the lack of practical applications. People can make broken abstractions without knowledge of the fundamentals like compositions or functors and still get their shit to work.

        That matters more to engineers then true understanding. So a lot of engineers end up trying to understand it and when they fail they easily move on to other things because it's not required knowledge for their job.

      • fatneckbeard 350 days ago
        category theory has a very hard "k" sound at the front and a g sound which is also hard, which makes people react more strongly to the name than order theory or abstract algebra.
    • l__l 350 days ago
      So I come at this from a mathematical background --- graduate student in categorical algebra --- but I've done a couple years of SWE work, so I'm not unsympathetic to this point of view. The way I see it, when you want to reason about things like data processing (which is what a massive chunk of writing software is, moving data from form A to form B), category theory provides what is in some sense the "correct" language/framework in which to think. It's not just an abstraction circle-jerk, it's a genuinely useful perspective, particularly for guiding your mind to spot non-obvious connections between pieces of code.

      The problem as I view it is that CT is first and foremost a discipline of maths. It was developed to help mathematicians, is very sophisticated, and very specialised; learning CT for SWE is taking a sledgehammer to a nut. I can't honestly recommend it as a field of study to someone who isn't interested in the problems it was developed to solve. If you don't have a solid grounding in set theory, logic, algebra, topology, etc., it's a very tough field to motivate. The vast majority of CT is of little to no relevance for SWE work. Adjunctions, for example, are absolutely fundamental to all of maths, but in truth are not really relevant for SWEs. As a result, you see people trying to teach concepts like monads without reference to them; this is slightly insane from where I'm standing...

      Your question about whether there are things CT does that other branches didn't already do; one of the fundamental utilities of CT in pure mathematics is "making trivial things trivially trivial". That is to say, it makes it very clear which parts of your problem are local to your specific situation, and which are purely "structural" from the categorical constraints. The SWE analogy would be separating business logic from other layers. So at least for mathematicians, it absolutely does have novel utility, and has drawn links between a huge number of disparate studies that were not well-understood previously.

      So if you _do_ care about posets and groups and cohomology theories, CT will genuinely open your eyes, and (albeit, this coming from someone with less working experience than yourself) it could give you a deeper, or at least different understanding of the code you're writing. Otherwise, I'm not sure it's worth putting yourself through it, tbqh.

      (If you do decide to give it another go, please use a better resource than the linked post; after a quick scan it looks pretty weak)

      • skrtskrt 350 days ago
        I think this is a good perspective - it follows the general approach in software engineering that if you're going to introduce something with a massively different approach, learning curve, and cost of adoption, it needs to come with the associated real-world benefits.

        For most software stuff it would be very hard the benefit of introducing this stuff vs. what the standard paradigms that everyone already knows

      • deterministic 350 days ago
        Agree. If you care about abstract mathematics that is useful for developing practical software then don’t waste your time with CT.
    • umanwizard 350 days ago
      Category theory has virtually zero application to software engineering. Abstract algebra (knowing what a group, monoid, etc. are) has a bit more practical application. Knowing what a monad is (in the programming sense) has some as well. Neither of the latter two require learning category theory.
      • proc0 350 days ago
        CT describes type theory really well, which is used in a lot of programming languages. Monoids and Monads come from CT, and their implementation doesn't really explain what the concept really is (it kind of does, but not really). The programmer might not need to learn CT, but it helps to have broader understanding of how the underlying rules of the language are working.
        • deterministic 350 days ago
          Nope. Type Theory (like Matin Luff TT) describes Type Theory really well. And it is way more useful for software development than CT is. Tools like Coq, LEAN, Agda, Idris etc. are built on TT not CT.
        • umanwizard 350 days ago
          Monoids do not come from category theory, they come from abstract algebra.

          How does category theory “describe type theory” ?

      • francogt 350 days ago
        > Category theory has virtually zero application to software engineering. > Knowing what a monad is (in the programming sense) has some [practical application]as well.

        You’re contradicting yourself. You don’t need to know category theory to use practical abstractions like functors and monads. They are still however category theoretical concepts. If these category theoretical concepts have “some practical application” as you say, then category theory does have application to software engineering.

        • umanwizard 350 days ago
          It had application in the sense that it provided inspiration for these concepts, yes. However learning anything else from category theory is irrelevant to understanding and using them.
    • wisnesky 350 days ago
      If you have a symmetric system, you can use group theory to make predictions about it. Similarly, if you have a compositional system, you can use category theory to make predictions about it. As for whether those predictions are useful, or non-obvious, or worth it, etc, tends to very a lot depending on the application, and the other techniques available- it's not a matter of being smart enough to get it. FWIW, I think category theory is certainly indispensable in denotational programming language semantics.
    • dr_kiszonka 350 days ago
      I can't answer your question in terms of pragmatic applications. Based on skimming this book and similar resources posted on HN, my -- naive, I am sure -- understanding is that category theory unifies other theories and serves as a glue.

      One example from the linked book, "Remember that we said that programming types (classes) are somewhat similar to sets, and programming methods are somewhat similar to functions between sets, but they are not exactly identical? A formal connection between the two can be made via category theory."

    • hermitcrab 350 days ago
      >Working as a SWE for lots of years, I've worked with people that always feel the need to "add a level of abstraction" or "build a framework" for (and out of) everything.

      You might be interested to read Spolsky's essay on 'architecture astronauts': https://www.joelonsoftware.com/2001/04/21/dont-let-architect...

      • nuancebydefault 350 days ago
        Very funny to read, especially because it feels outdated. "With this new architecture we cannot simply..." years after we can say we can! Edit - "No, Sun, we’re not going to be able to analyze our corporate sales data “as simply as putting a DVD into your home theatre system.”" is what I am talking about
        • hermitcrab 349 days ago
          It was written in 2001. But the architecture astronauts are still with us.
    • bmacho 350 days ago
      > Every time I try to learn about Category Theory, I get to a certain point and just start wondering "why?"

      > I can't tell if I'm not smart enough to get it (I think that's the most likely answer). But it feels like some math people -- who have nothing better to do -- are just trying to create another level of abstraction.

      > Are there things that Category Theory does that other branches couldn't already do? I'm curious to hear other takes on this.

      No, category theory was not created for the sake of an another level of abstraction. It was created to talk about algebraic topology. I am not sure if you gain anything studying that. Probably you won't but who knows. (But I am thinking more and more that CT advocates are harmful, they trick people to dive into CT which just steals their time, and gives them nothing.)

    • mrkeen 349 days ago
      > I've worked with people that always feel the need to "add a level of abstraction" or "build a framework" for (and out of) everything

      This is my experience with the Java folk, and they're certainly not being inspired by category theory.

      Indirection isn't abstraction. What I usually come across is someone wanting to make a REST POST, but they wrap it in a networkconnection in a networkclient in a networkworker in networkmanager, which can only be instantiated by a network factory.

      CT-thinking (not that I've studied any) is more like: a POST is an arrow from request to response. Can we join such items head-to-tail? Is it ok to substitute createUser.then(createPassword()) for createUserAndPassword? Can we map over the arrow without unpacking it and repacking it, etc.

      Have a read of https://www.haskellforall.com/2014/04/scalable-program-archi...

    • agentultra 350 days ago
      You haven’t taken the time to understand it, therefore it must be useless. Others who practice it must be doing useless things. This seems like a common solipsism among software developers.

      The problem with your definition of abstraction is that you’re thinking of indirection.

      Abstractions in mathematics create precise definitions with provable laws. When you have a proof of a theorem you can ignore the details underneath and think in terms of the abstraction.

      I wouldn’t be so cavalier about dismissing category theory. It’s interesting for many reasons but it’s not here to serve you. You could find ways that it can improve your programs and how you think about them, as others have, or you can get on without it. And that’s fine too!

    • proc0 350 days ago
      Abstraction is powerful. It lets you control more with less. As you keep abstracting things get complicated. Category Theory studies abstractions and lets you build extremely abstract systems, which can be leveraged to create reliable and also flexible systems. The downside is of course the learning curve, and because of this it isn't as friendly for business and teams to use. In an ideal tech industry (in my opinion), engineers are encouraged to persue the most complicated engineering, despite the rest of the company having very little idea of how it works. It would require a lot of trust, and also a different work ethic, but I digress.
    • deterministic 350 days ago
      You are most definitely smart enough. And your instincts are correct. Category Theory is not an efficient thinking tool for thinking about software. You can use it for that of course (monads were originally modelled in CT) but there are much better tools out there that will get you there faster (Abstract Algebra, Reduction Machines and State Machines for example).

      There are a few (usually Haskell) people that love to make claims about the need for you to learn CT. They are wrong. It’s that simple.

    • pohl 350 days ago
      Mathematics, at its foundations, loves to see how much they can get with the smallest number of concepts and assumptions. It’s good to learn what’s really necessary.
    • adamnemecek 350 days ago
      It's a general scaffolding that can be shared between branches of math.
      • resource0x 350 days ago
        Between some branches of math. And you have to be familiar with these branches of (graduate level) math to appreciate it. Learning category theory in isolation will leave you baffled. Why it's being constantly pushed on HN is beyond me.
        • gryn 350 days ago
          > Why it's being constantly pushed on HN is beyond me.

          the answer is haskell

          • dimitrios1 350 days ago
            And that's a fine enough reason. Sometimes learning assembly leads people to learn about electrical engineering concepts, and boolean algebra. Sometimes writing algorithms that need to be efficient leads people to learn about number theory. Sometimes people trying to develop a really effective database schema get interested in set theory.

            These are good things.

            • epgui 350 days ago
              Exactly, and it's supposed to be what this forum is all about: intellectual curiosity and (to some degree) interdisciplinary knowledge-sharing!

              It drives me nuts that the anti-intellectual stance is so prevalent.

              • resource0x 350 days ago
                I actually put some effort in learning it, and found it intellectually empty. If you find it enlightening - good for you. :-)
                • epgui 350 days ago
                  You must have an interesting definition of "intellectual" lol...
            • gryn 350 days ago
              I agree, just pointing out the reason/gateway drug.
    • mirekrusin 350 days ago
      They just want to articulate levels of abstractions for abstractions.
    • HervalFreire 350 days ago
      It just hasn't clicked for you yet.

      I wouldn't call it "another level of abstraction"

      It's more of a "fundamental theory of abstraction". Once it clicks you can see it. And you will see all the design patterns and abstractions you see in books like the gof are the ones that are "arbitrary layers of abstraction"

      That's why a lot of programmers want to incorporate the concepts into their languages. Because once it clicks you realize that all other abstractions (especially design patterns in oop) are flawed and wrong.

      You start to see cracks and broken abstractions everywhere. This is not just another GoF design patterns thing. It's fundamental.

      But the thing is it's so hard usually if you get it, you'll be living in a world where most people don't get it. So people will have trouble understanding you.

      If you don't ever get it, I would view it as a layman would view quantum physics or general relativity. You know it's a more fundamental description of the universe but you just can't grasp it.

    • epgui 350 days ago
      Why are we not all downvoting anti-intellectualist comments like this?

      The odds that a whole discipline of mathematics is "of little use" or "nothing more than an inappropriate abstraction" is basically nil.

      I see little difference between this comment, and a comment that calls sociology or philosophy useless. No sympathy from me!

      • timmg 350 days ago
        Sorry if I offended your sensibilities. Feel free to downvote my comment if you don’t think it adds to the conversation.

        I would appreciate, though, if you didn’t misquote my comment when replying to it. Neither of the things you have quoted are things I wrote. Worse, they are a misrepresentation of my comment.

      • thfuran 350 days ago
        Why? For a lot of mathematicians, work being of practical use isn't even a consideration. I know math professors who would freely tell you that they were never aware of any application for their PhD work and never cared, because it was interesting. A lot of math does have a lot of useful applications, and there certainly are applied mathematicians, but it is not, on the face of it, absurd to suppose that there are areas of math with little to no known practical application.
        • epgui 350 days ago
          > I know math professors who would freely tell you that they were never aware of any application for their PhD work and never cared, because it was interesting

          Exactly, but that's the opposite of an anti-intellectual attitude. It's not anti-intellectual to engage with pure maths-- on the contrary lol! What's anti-intellectual is to say that if you can't see the value of maths, that it's not worth engaging with. You'll never see the value of anything if you don't engage with it, and also I'm pretty sure that by now people shouldn't need any convincing that maths is worth learning.

          And when I say "engage with maths" I don't mean "I read an article or a book once but I didn't get it so I decided that it wasn't worth the time".

  • sriram_malhar 350 days ago
    Whenever I have tried any text about category theory, it seems to me that it is a catalogue of one definition after another. I am yet to come across (or perhaps missed it entirely) an example use of any of these definitions in practical terms, other than their use in the next definition. It is quite possible that one requires a lot of set up before any it can be used for practical purposes (e.g explaining the basis for all of Haskell's prelude), but I have never made it that far. But I would like to ...

    I'd appreciate hearing from those of you who are programmers at heart and have hung in there long enough to gain some insight. What clicked for you?

    • dirkt 350 days ago
      I've also seen this in many books.

      When I learned it at university, we had lots of examples, but you need to be already familiar with a lot of somewhat abstract mathematics (monoids, groups, rings, sets, homomorphisms, ...) before you see how it unifies those.

      Category theory is called "general abstract nonsense" for a reason.

      You can think of it as "expressing other mathematics in terms of arrows and commuting diagrams".

  • dang 350 days ago
    Related:

    Category Theory Illustrated – Functors - https://news.ycombinator.com/item?id=35173632 - March 2023 (3 comments)

    Category Theory Illustrated – Logic - https://news.ycombinator.com/item?id=28660157 - Sept 2021 (112 comments)

    Category Theory: Orders - https://news.ycombinator.com/item?id=26658111 - April 2021 (52 comments)

  • superb-owl 350 days ago
    I'm enjoying the article, but this line is comically false:

    > noone bashed string theory for failing to make useful predictions

    • diyseguy 350 days ago
      not to mention the "moist interesting category-theoretical concepts"
      • Koshkin 350 days ago
        Speaking of those - they are not even mentioned in the text (yet), but without them any presentation of CT will seem necessarily dry: natural transformations and equivalence; adjunctions; and, of course, monads (them being monoids in the category of endofunctors notwithstanding).
  • akdor1154 350 days ago
    Not sure if the author is here, but I would happily fling a few dollars his way for an epub/pdf. This looks great.
  • FrustratedMonky 350 days ago
    It isn't first time there has been long threads about Category Theory with so much controversy. How does a subject like this get people so worked up? Maybe it is just all cross functional subjects, where a lot of people know a little bit of some aspect and make some sweeping assumptions. Kind of like all posts about AI are controversial now, because everyone is arguing from some thin slice of their perception on the subject.
    • bruce343434 349 days ago
      Frustration? A CT is a huge topic yet people struggle to really "get" it. That creates cognitive dissonance.
  • yazzku 350 days ago
    > In other words, we can solve problems without any advanced math, or with no math at all, as evidenced by the fact that the agyptians were able to build the pyramids without even knowing Euclidian geometry.

    Egyptians. Capital E regardless too.

    Also, the Egyptians knew a fair amount of geometry:

    https://en.wikipedia.org/wiki/Egyptian_geometry

    https://en.wikipedia.org/wiki/History_of_geometry

    https://www.britannica.com/science/mathematics/Mathematics-i...

    • boris_m 349 days ago
      "...without even knowing Euclidian geometry."
      • yazzku 349 days ago
        What exactly about Euclidian geometry is it that the Egyptians needed to build the pyramids? Clearly nothing. My point is that this part of the text is just fluff. Engineers have been building shit without having a formal description of that shit for millennia.
  • teleforce 350 days ago
    This looks like a very good book on Category Theory with a lot of illustrations. Anyone can compare between this book and The Joy of Abstraction by Eugenia Cheng for learning Category Theory beginner?

    https://golem.ph.utexas.edu/category/2023/02/the_joy_of_abst...

  • mjmsmith 350 days ago
    “The set of queens of England is a singleton set.”

    Hmmm.

    • yazzku 350 days ago
      It's for sure a bad set of examples.

      There have been several queens of England. At the very least you should know Bloody Mary, if not for the Tudor's legacy of a golden age with Queen Elizabeth (another queen!), then for the goddamn alcoholic drink. And I'm not even British.

      "The set of all red balls contains just one ball."

      There are many reds too...

      It's just unintuitive to try to force "intuitive" examples into a mathematical framework... Might as well just do it the right, formal way.

      • FrustratedMonky 350 days ago
        I think it is referring to the concept of one ruler at a time 'The King is dead, long live the king' means there is only one king, one is gone, and in same sentence the new one is in place. There is only ever one.
  • pstoll 350 days ago
    > People don’t expect any return on investment from physical theories - noone bashed string theory for failing to make useful predictions.

    Uhhh… heck yeah they did. It’s the primary and most widely challenged aspect of the theory. This does not help your paper be more credible.

  • galaxyLogic 349 days ago
    I wonder, SQL is based on, and implements the calculational aspects of Sets. Could we similarly think of a programming language that was based on and implemented the basic concepts of Category Theory? What might such a thing be useful for?
  • Myrmornis 350 days ago
    This looks excellent. Are more chapters planned and is there a way to buy a PDF?
  • yazzku 350 days ago
    Sorry, it's a very low-quality "book". See the other comments for reasons why. This is going to need a lot of improvement before it can be recommended. I'd love to see a casual/friendly introduction to the topic, though.
  • jbottoms 350 days ago
    "...and mathematics their" ?
  • Koshkin 350 days ago
    > Illustrated

    Isn’t what diagrams were for?

  • lincpa 350 days ago
    [dead]