Bubble#
- class discopy.monoidal.Bubble(inside, dom=None, cod=None, **params)[source]#
-
Bubble in a monoidal diagram, i.e. a unary operator on homsets.
- Parameters:
inside (discopy.monoidal.Diagram) – The diagram inside the bubble.
dom (discopy.monoidal.Ty, optional) – The domain of the bubble, default is
inside.dom
.cod (discopy.monoidal.Ty, optional) – The codomain of the bubble, default is
inside.cod
.
Examples
>>> x, y = Ty('x'), Ty('y') >>> f, g = Box('f', x, y ** 3), Box('g', y, y @ y) >>> d = (f.bubble(dom=x @ x, cod=y) >> g).bubble() >>> d.draw(path='docs/_static/imgs/monoidal/bubble-example.png')
- downgrade()[source]#
Downcasting to
discopy.monoidal.Bubble
.