Unpack

Contents

Unpack#

class discopy.closed.Unpack(dom)[source]#

Bases: Box

The canonical isomorphism from a Product type to the tensor of its factors, i.e. the dagger of Pack.

Parameters:

dom (C0) – The product type to unpack.

Example

>>> X, Y = Ty("X"), Ty("Y")
>>> assert Unpack(X * Y).dom == X * Y and Unpack(X * Y).cod == X @ Y
>>> assert Unpack(X * Y).dagger() == Pack(X * Y)