Compact#

class discopy.para.Compact(dom, cod, inside, param=None, copar=None)[source]#

Bases: Traced, discopy.abc.CompactCategory

Parametric maps over a compact underlying category form a compact category, with the cups and caps of the underlying category.

Parameters:
  • dom (ob)

  • cod (ob)

  • inside (category)

  • param (ob)

  • copar (ob)

category#

alias of Diagram

classmethod cups(left, right)[source]#

The cups of the underlying category, with empty parameter space.

Parameters:
  • left (Ty) – The left-hand side of the cups.

  • right (Ty) – Its adjoint, i.e. the right-hand side of the cups.

Return type:

Compact

classmethod caps(left, right)[source]#

The caps of the underlying category, with empty parameter space.

Parameters:
  • left (Ty) – The left-hand side of the caps.

  • right (Ty) – Its adjoint, i.e. the right-hand side of the caps.

Return type:

Compact

classmethod ev(base, exponent, left=True)#

The evaluation of the underlying category, with empty parameters.

Parameters:
  • base (Ty) – The base of the exponential type.

  • exponent (Ty) – The exponent of the exponential type.

  • left (bool) – Whether to take the left or right evaluation.

Return type:

Closed

curry(n=1, left=False)#

Curry the last n objects of the domain if left else the first, i.e. everything but the parameters, which a left currying swaps out of the way the same as Traced.trace().

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

  • left (bool) – Whether to curry into a left or right exponential.

Return type:

Closed