You are viewing a single comment's thread from:

RE: Mathematics for Software Design: Functions, Categories, and Functors!

in #steemstem6 years ago

Very nice post. I've been working on understanding category theory for some time in hopes of applying to my work in information visualization. For programmers I think introducing CT through programming makes a lot of sense. I have worked through some of Bartosz Milewski's Category Theory for Programmers, but I'm not a C++ programmer so I find it a bit difficult to follow. (As an aside, as a C programmer, I was very disappointed with C++ when it was first released because I was hoping for a far more principled and elegant language with strong support for abstract data types.)

I started to struggle a bit above with section 3.2. It may help to include diagrams of objects and arrows in this article.

Also, the view of functions as arrows and types or instances as objects is helpful to programmers, but we also need to understand how to model data types as categories. This is one area where I keep getting stumped in my work on applying CT to visualization. I would like to model the basic scales of measurement (nominal, ordinal, interval, and ratio) as categories. Nominal requires modeling equality (and inequality). This could be a category with the nominal scale's values as objects and identify arrows only, but that does not seem to capture the idea that you must also be able to determine inequality.

Ordinal scales are much harder. For example, the typical US grading scale (A, B, C, D, F) is a good example of an ordinal scale. Ordinal scales are strict total orders, but so far I've not been able to find a single example of a strict total order modeled as a category. Partial orders are easy using the <= relationship as arrows, but all of the examples seem to stop here.

Sort:  

Thank you for your comment. I will work on improving sections 3+ for future editions. This post still fails to address some core categorical intuitions. So a 2.0 version is certainly coming.

...in hopes of applying to my work in information visualization

Interesting! Good luck with that!

I will post more about CT in the following months. Eventually I'll get into the area of your concern, i.e. modelling your particular concepts as categories.

For now I can only say:

You don't have to model your data structures as a Category in order to have a categorical design. If it's not a category, it's not a category, period. E.g. in Haskell you have the Category type class, but if a data structure doesn't satisfy the category axioms, then that's that.

Maybe your concept is an object within a category. E.g. an arrow. an object. A limit. Or some other categorical construct, and not a category in and of itself.

P.S. Maybe the "ologs" theory, developed by David Spivak, could serve your interests. If only for seeing categorical applications to modelling in action. It's like what people do with UML diagrams, except this one is helpful. :P

thanks for the response. The issue I found with Spivak is that he uses far too many mathematical concepts before getting to the heart of CT. For instance, you got to functors in one post, but it takes him chapters. ologs do make sense though and I like his analysis of databases as categories. Looking forward to more of your posts.