A simple function to curry a function with an arbitrary number of arguments.