MonoidalCategory#

class discopy.abc.MonoidalCategory[source]#

Bases: Category, Generic

A monoidal category is a Category with a method tensor for both its objects and its arrows.

This base class also implements syntactic sugar @ for whiskering.

abstract classmethod id(dom)[source]#

Identity on a given domain, to be instantiated.

Parameters:

dom (T) – The object on which to take the identity.

Return type:

MonoidalCategory

abstract tensor(other)[source]#

Parallel composition, to be instantiated.

Parameters:

other (MonoidalCategory) – The other arrow to compose in parallel.

Return type:

MonoidalCategory

classmethod whisker(other)[source]#

Apply MonoidalCategory.id() if other is not tensorable else do nothing.

Parameters:

other (T) – The whiskering object.

Return type:

MonoidalCategory