chicken_turtle_util.function

Function manipulation, like functools. Contains only compose, compose functions.

compose Compose functions
chicken_turtle_util.function.compose(*functions)[source]

Compose functions

Like the o operator in math.

Parameters:

functions : collection(any -> any)

Collection of one or more functions to compose.

Returns:

any -> any

Function composed of functions

Raises:

ValueError

When len(functions) < 1

Examples

compose(f1, f2) is equivalent to f1 o f2, or to lambda x: f1(f2(x))