Closed#

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

Bases: Markov, discopy.abc.ClosedCategory

Parametric maps over a closed underlying category form a closed category, currying with the parameters swapped out of the way.

Parameters:
  • dom (ob)

  • cod (ob)

  • inside (category)

  • param (ob)

  • copar (ob)

category#

alias of Diagram

classmethod ev(base, exponent, left=True)[source]#

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)[source]#

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