Type Systems
Example ?-calculus language:
C = I ? F where
I = {…, -2, -1, 0, 1, 2 …}
F = {+, -, *, / }
?(i) = int for i ? I; ?(f) = int ? (int ? int)
What is type of (?f: int ? int (?g: int ? int (?x: int (f (g x)))))?
(int ? int) ? ((int ? int) ? (int ? int))
which is the “curried” form of
(int ? int) ? (int ? int) ? (int ? int)