Generates a function that is called with initially supplied arguments