Function¶
monad.types.function - The Function Wrapper.
-
class
monad.types.function.
Function
(callable_object)[source]¶ Bases:
object
The Function Wrapper.
Support function composition via
*
operator.>>> add_1 = Function(lambda n: n + 1) >>> inc = add_1 * int >>> inc('42') 43
Support function piping via
|
operator.>>> inc2 = int | add_1 | add_1 | str >>> inc2('42') '44'