archives

Understanding category theory and its practical applications

Note on the obvious: these thoughts represent my original state of mind when this post was first made, and do not necessarily reflect my current understanding. This OP is left unmodified for reference purposes.

Introduction

Various logics and mathematics, such as set theory, predicate calculus, arithmetic, et. al. were relatively intuitive and came easy to grasp when I learned them. Additionally, they came with their obvious applications, not just to problems in the real world, but also to programming and programming languages. It is easy to see the higher level of abstraction that comes from using these as opposed to a computation-oriented programming language.

Predicate calculus, in particular, is a powerful language suited to various boons from a programmer's perspective, including arbitrary constraint qualification as a means to better aspect-oriented programming. However, I have not been able to identify any such gains from category theory. I can't see how it is any better than anything else.

Note: My understanding of category theory is very shoddy, so using lots of category-theoretic terminology may obscure my understanding of your answer--being moderate will help. From what I gather, a morphism seems to be a transformation (possibly represented by one or more functions), and the objects in a category could be represented as a set. But if I am right, then how is category theory any better than just simply using functions, relations, and set theory?

I can never be sure if my understanding of category theory heads in the right direction, however, because nobody has tried to define category theory in a non-category-theoretic way, which has left me to wallow in the misery of trying to understand these concepts by googling for and reading all the non-terminating, mutually recursive definitions of such concepts. If all these proportedly wonderful concepts and discoveries made by scientists go over everyone else's heads, then how is anyone going to benefit? These concepts might as well have never been discovered, in such a case.

Prime points to address:

  1. Is it any better than set theory and predicate calculus, as far as abstraction is concerned? If so, how? What kinds of inferrable details does it abstract away (if it were to be employed within a programming language)?
  2. Is there a simple real-world metaphor to categories? I wonder how similar category theory is to mainstream-industry OOP.
  3. (Important!) How is it used to mathmatically/logically model story problems (like the kind you solve in a math class)? Can anyone produce story problems that can elegantly be solved using category theory, or that demonstrate the effectiveness of its paradigm for mathematical/logical modeling?