This is for the anonymous function indicated
by match.
match is of the form
pat => exp
|
| pat => exp
that indicates pairs of an argument pattern and its corresponding
function body.
The type of each pair of a pattern and expression
pat =¿ exp is calculated as follows:
first, the type ty of pat is
calculated;
second, under the environment extended with variables in
the pattern, the type ty of exp is
calculated;
and finally, the two types are combined into a function type
ty -> ty.
The type of this entire expression is
ty -> ty’
that is obtained by
unifying the types of the matching pairs.
The value of this function is the function closure
consisting of the current value environment and the function
expression itself.