Product

Contents

Product#

class discopy.closed.Product(*factors)[source]#

Bases: discopy.biclosed.Wire

The product of a tuple of types, which is not strictly associative, called with * in the binary case.

Parameters:

factors (Ty) – The factors of the product.

Example

>>> X, Y, Z = Ty("X"), Ty("Y"), Ty("Z")
>>> assert X * Y == Ty(Product(X, Y))
>>> assert (X * Y) * Z != X * (Y * Z) != X.product(Y, Z)

Evaluation strictifies a product to the tensor of its factors, see Pack, so that the three types above are all interpreted as X @ Y @ Z.

ob#

alias of Ty