4 ms·
> Category theory is in some sense exactly the theory of glue code. If you can explain this to the satisfaction of my understanding, I would like to subscribe
by whytaka 6y ago
> Category theory is in some sense exactly the theory of glue code.
If you can explain this to the satisfaction of my understanding, I would like to subscribe to your newsletter.
- eru 6y agoFirst a qualification: Category Theory doesn't teach you how to write glue code, but it can be seen as a theory to organizing some of our understanding of glue code. One simple example would just be a discussion around the different use cases of Functor, Applicative Functor, Arrows and Monads. And how they relate to common programming constructs like functions, tuples, arrays, Maybes, futures, whatever's happening in react, etc. Category theory won't help you learn those concepts, but once you know those concepts, even a superficial understanding of some category theory, can help you organize your thoughts. As a genuine application of category theory, whenever you find a useful abstraction (like eg functors or monads again), you can have a look at its dual, and see whether that's another interesting structure you haven't seen yet. Just like tuples and Either are duals of each other. (As an analogy, dualizing is also a concept in linear programming. Linear programming can help solve many interesting algorithmic problems, like sorting or matching or assignment or median selection, basically almost anything that's in P, and if you allow integer linear programming than you can solve what's in NP. However, I wouldn't recommend anyone who wants to learn about algorithms and data structures to start with linear programming. But once you know a bunch of algorithms, you can re-express the problems they are solving in terms of linear programming, and see whether you get anything interesting out of looking at their duals.)