class, dom, cod, data=None, is_dagger=False)[source]#

Bases: Arrow

A box is an arrow with a name and the tuple of just itself inside.

  • name (str) – The name of the box.

  • dom (T) – The domain of the box, i.e. the input.

  • cod (T) – The codomain of the box, i.e. the output.

  • data (any) – Extra data in the box, default is None.

  • is_dagger – Whether the box is dagger.


>>> x, y = Ob('x'), Ob('y')
>>> f = Box('f', x, y, data=[42])
>>> assert f.inside == (f, )