After learning Haskell and other not so pure FP languages I decided to read about Category theory. After gaining good understanding of Category theory I started thinking about how the concepts of category theory can be used to think about designing programs but no matter how hard I tried it seems this is not the way to go.
After spending many unsuccessful attempts to relate category theory to designing programs I came to the conclusion that:
- Category theory is useful when designing a programming language.
- Category theory is not something that you use when designing programs (even when using a language which was designed based on category principles). For example: When programming in Haskell you will use types, types constructor, functions, higher order functions etc to design your program, not category theory concepts.
In summary we have below layer system (order is low to high):
Category theory -> Programming language -> Program
At a particular layer you use the concepts of the immediate underlying layer.
Is this understanding correct? If not and you believe that in designing programs we can directly use category theory concepts, please refer some articles or blog posts where it is being demonstrated.
NOTE: By designing programs I mean designing programs based on different concepts, like concurrency, parallelism, reactive, message passing etc.