Exam-style question
Try this first
What is the result of partially applying add to the integer 4?.
- A.An integer with the value 4
- B.A function of type integer → integer
- C.A function of type integer → (integer → integer)
- D.An integer with the value 8
Model answer
What a good answer should say
- A function of type integer → integer
Explanation
Why this works
The expression add 4 returns a function which can be applied to another integer. Therefore, its type is integer → integer.
Common mistake
No common mistake is linked to this question yet.
