We can create curried functions manually, without using the decorator from the PyMonad library; one way of doing this is shown in the function definition that follows:
def f(x, *args): def f1(y, *args): def f2(z): return (x+y)*z if args: return f2(*args) return f2 if args: return f1(*args) return f1
This curries a function, , into a function, f(x), which returns a function. Conceptually, . We then curried the intermediate function to create the f1(y) and f2(z) function, .
When we evaluate the f(x) function, we'll get a new ...