6.12.6.4. Tagged category

The same category, with an arrow a converted to a pair (tag, a).
Start python section to interscript/felix/model/cons.py[5 /6 ] Next Prev Last
   107: #line 131 "felix_cons.ipk"
   108: class cat_tagged(category):
   109:   def __init__(self, tag, arg):
   110:     self.arg = arg
   111:     self.tag = tag
   112: 
   113:   def is_arrow(self,arrow):
   114:     return arrow[0] == self.tag and self.arg.is_arrow(arrow[1])
   115: 
   116:   def is_object(self,object):
   117:     return arrow[0] == self.tag and self.arg.is_object(arrow[1])
   118: 
   119:   def compose(self, left, right):
   120:     return (self.tag, self.arg.compose(right[1], left[1]))
   121: 
   122:   def domain(self, x):
   123:     return (self.tag, self.arg.codomain(x))
   124: 
   125:   def codomain(self, x):
   126:     return (self.tag, self.arg.domain(x))
   127: 
   128: class unique_tag: pass
   129: 
End python section to interscript/felix/model/cons.py[5]