Id#

class discopy.monoidal.Id(dom=Ty())[source]#

Bases: Id, Diagram

Implements the identity diagram of a given type.

>>> s, t = Ty('x', 'y'), Ty('z', 'w')
>>> f = Box('f', s, t)
>>> assert f >> Id(t) == f == Id(s) >> f