Whiskerable#

class discopy.monoidal.Whiskerable[source]#

Bases: ABC

Abstract class implementing the syntactic sugar @ for whiskering and parallel composition with some method tensor.

abstract classmethod id(dom)[source]#

Identity on a given domain, to be instantiated.

Parameters:

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

Return type:

Whiskerable

abstract tensor(other)[source]#

Parallel composition, to be instantiated.

Parameters:

other (Whiskerable) – The other diagram to compose in parallel.

Return type:

Whiskerable

classmethod whisker(other)[source]#

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

Parameters:

other (any) – The whiskering object.

Return type:

Whiskerable