Hi Alec! Sage has categories, to some extent. But by far not enough!
For instance, currently there is no framework to construct an actual functor: The existing functors in Sage take an object and create a new object out of it -- but they do *not* take a morphism and create a new morphism out of it. I implemented it at ticket #8807, and (after fixing a bug) it is again ready for review (hint...)! Your question made me look into the reference manual again. At least, the reference manual has http://www.sagemath.org/doc/reference/categories.html, with sections on: - category theory - functorial constructions - categories - examples of parents using categories The problem is that in most cases the so-called "examples" in the documentation explain absolutely nothing. In particular, they don't explain how to use the present framework. It is *not* explained, - how to implement a new category, - how to implement a Python class for a new object (and its elements) in an existing category, - how to implement a functor between two existing categories, ... The examples, in most cases, simply demonstrate that someone has implemented some example of something (e.g., a semigroup) in Sage, but there is no hint what is actually needed to do for implementing a new semigroup. Would it really hurt to state: "To implement a semigroup, define a class that inherits from `UniqueRepresentation` and `Parent`. Implement a class method `product(self,x,y)` defining how two elements x,y of your semigroup are multiplied, and implement `an_element(self)`, that returns one element of your semigroup. To implement elements of your semigroup, ..." ? Apart from that, ideas from category theory are used in an interesting part of Sage: Coercion. Here, one works with so-called construction functors, and when you add an element of ZZ['x'] to an element of QQ (so that the result lives in QQ['x']), then behind the scenes some pushout construction is done. But probably this is not directly related to your question. Again, the documentation is too little. But #8800 (depending on #8807) should considerably improve it. Best regards, Simon -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org