BiclosedCategory#
- class discopy.abc.BiclosedCategory[source]#
Bases:
MonoidalCategory,GenericA biclosed category is a
MonoidalCategorywith methodsevandcurryfor the evaluation and currying of morphisms.We also assume the type for objects comes with methods for left and right exponentials :code`x << y` and :code`x >> y`.
- abstract classmethod ev(base, exponent, left=True)[source]#
The evaluation of an exponential type, to be instantiated.
- Parameters:
base (C0) – The base of the exponential type.
exponent (C0) – The exponent of the exponential type.
left (bool) – Whether to take the left or right evaluation.
- Return type:
C1
- abstract curry(n=1, left=True)[source]#
The currying of a morphism, to be instantiated.
- Parameters:
n (int) – The number of objects to curry.
left (bool) – Whether to curry on the left or right.
- Return type:
C1
- base_and_exponent(n, left)[source]#
The base and exponent that
uncurry()evaluates, read off the exponential object in the codomain.- Parameters:
n (int) – The number of objects to uncurry.
left (bool) – Whether to uncurry on the left or right.
- Return type:
tuple[C0, C0]
- uncurry(n=1, left=True)[source]#
Uncurry a morphism by composing it with
ev(), assuming its codomain is an exponential object. If the exponent has less thannobjects, we uncurry the remaining ones in turn.- Parameters:
n (int) – The number of objects to uncurry.
left (bool) – Whether to uncurry on the left or right.
- Return type:
C1