Function#

class discopy.python.function.Function(inside, dom, cod)[source]#

Bases: Composable[type], Whiskerable

Python function with sequential composition.

Parameters:
  • inside (Callable) – The callable Python object inside the function.

  • dom (type) – The domain of the function, i.e. its input type.

  • cod (type) – The codomain of the function, i.e. its output type.

Summary

id(dom)

The identity function on a given tuple of types dom.

then(other)

The sequential composition of two functions, called with >>.

classmethod id(dom)[source]#

The identity function on a given tuple of types dom.

Parameters:

dom (type) – The typle of types on which to take the identity.

Return type:

Function

then(other)[source]#

The sequential composition of two functions, called with >>.

Parameters:

other (Function) – The other function to compose in sequence.

Return type:

Function