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."
the answer is haskell
These are good things.
It drives me nuts that the anti-intellectual stance is so prevalent.
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.
How does category theory “describe type theory” ?
You might be interested to read Spolsky's essay on 'architecture astronauts': https://www.joelonsoftware.com/2001/04/21/dont-let-architect...
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)
For most software stuff it would be very hard the benefit of introducing this stuff vs. what the standard paradigms that everyone already knows
> 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 one 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.)
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.
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.
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.)
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.
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.
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.
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.
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!
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.
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".
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!
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.
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.
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...
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.