Function#
- class discopy.python.multiplicative.Function(inside, dom, cod)[source]#
Bases:
discopy.python.function.Function,discopy.abc.ClosedCategoryPython function with tuple as tensor.
- Parameters:
Summary
tensor(other)The parallel composition of two functions, called with
@.swap(x, y)The function for swapping two lists of types
xandy.copy(x[, n])The function for making
ncopies of a list of typesx.discard(dom)The function discarding a list of types, i.e. making zero copies.
ev(base, exponent[, left])The evaluation function, i.e. take a function and apply it to an argument.
curry([n, left])Currying, i.e. turn a binary function into a function-valued function.
uncurry([left])Uncurrying, i.e. turn a function-valued function into a binary function.
fix([n])The parameterised fixed point of a function.
trace([n, left])The multiplicative trace of a function.
- static braid(x, y)#
The function for swapping two lists of types
xandy.
- static ev(base, exponent, left=True)[source]#
The evaluation function, i.e. take a function and apply it to an argument.
- curry(n=1, left=True)[source]#
Currying, i.e. turn a binary function into a function-valued function.
- Parameters:
n – The number of types to curry.
left – Whether to curry on the left or right.
- Return type:
- uncurry(left=True)[source]#
Uncurrying, i.e. turn a function-valued function into a binary function.
- Parameters:
left – Whether to uncurry on the left or right.
- Return type:
- fix(n=1)[source]#
The parameterised fixed point of a function.
- Parameters:
n – The number of types to take the fixed point over.
- Return type: