Exam-style question
Try this first
Explain the meaning of the type f: integer x integer → integer. In your answer, explain both sides of the arrow and the significance of integer x integer.
Model answer
What a good answer should say
- The type states that f takes an input from integer x integer and produces an output of type integer.
- The expression integer x integer is the Cartesian product of the set integer with itself, so an input can be represented as a pair of integers, such as (3,4).
Explanation
Why this works
A complete answer identifies the input type, the output type, and the meaning of the Cartesian product. The arrow shows that the result is an integer, while the product on the left describes pairs of integers as inputs.
Common mistake
No common mistake is linked to this question yet.
