Exam-style question
Try this first
A function takes three integer arguments one after another and returns an integer. Describe the result of supplying only the first argument, and then the result of supplying the first two arguments. Use type notation in your answer.
Model answer
What a good answer should say
- The function can be represented as integer → integer → integer → integer when the brackets are omitted.
- After the first integer is supplied, the result is a function of type integer → integer → integer.
- After the first two integers are supplied, the result is a function of type integer → integer.
- Supplying the third integer then produces the final integer result.
Explanation
Why this works
Each supplied argument reduces the number of arguments still required by one. The intermediate results are functions, not final integer results, until all three arguments have been supplied.
Common mistake
No common mistake is linked to this question yet.
