|
|
|
|
|
by lmm
3878 days ago
|
|
You're just telling me how the abstraction gives rise to more abstractions. That seems to be getting even further away from where the rubber hits the road. I want to see a program that does something directly useful, something there's an actual business case for, that would take more code to implement without the Category abstraction. |
|
If you haven't already, you should play around with the pipes library, because it makes very heavy use of categories and it's an extreme positive example of composability.
As another practical example, Haskell's class constraints form a thin category, with constraint entailment as arrows. This means that instance resolution never depends on ordering of imports, local bindings, or basically anything other than the raw set of available instances, and also any two instances at the same type must be equal. This buys us great scalability and refactorability, most notably in comparison to Scala, where alphabetizing module imports sometimes breaks programs.
That said, in category theory one rarely works with vanilla categories but rather other abstractions formulated in categorical language. Similarly, in Haskell vanilla categories aren't as useful as the many well-known categorical abstractions (basically, the core Functor - Applicative - Monad hierarchy is directly category-theory inspired, and they've proven to be insanely useful).