CMap#

class discopy.biclosed.CMap(dom, cod, boxes, edges, offsets=None, loops=())[source]#

Bases: discopy.monoidal.CMap

Parameters:
  • dom (C0) –

  • cod (C0) –

  • boxes (tuple[Box, ...]) –

  • edges (Iterable[int]) –

  • offsets (tuple[int | None, ...] | None) –

  • loops (tuple[C0, ...]) –

category#

alias of Diagram

curry(n=1, left=False)[source]#

Curry a combinatorial map using the closed structure of the host category.

Parameters:
  • n – The number of objects to curry.

  • left – Whether to curry on the left or right.

Return type:

Self

>>> from discopy.closed import Ty, Box
>>> from discopy.drawing import Equation
>>> x, y, z = map(Ty, "xyz")
>>> f = Box("f", x @ y, z).to_map()
>>> f.curry().uncurry().draw(
...     path="docs/_static/cmap/biclosed-curry-right.png", show=False)
../_images/biclosed-curry-right.png
>>> f.curry(left=True).uncurry(left=True).draw(
...     path="docs/_static/cmap/biclosed-curry-left.png", show=False)
../_images/biclosed-curry-left.png
uncurry(n=1, left=False)[source]#

Uncurry a combinatorial map using the evaluation box of the host category.

Parameters:
  • n – The number of objects to uncurry.

  • left – Whether to uncurry on the left or right.

Return type:

Self