The type fh is held abstract by encoding the client as a polymorphic function
Intuitively, the independence of nonlocal procedures from local state corresponds to the parametricity of a polymorphic function whose type argument ranges over possible pieces of local state [Reynolds 1983; O'Hearn and Tennent 1995].
(The translation could be arranged so that each M* was a polymorphic function of type [MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII].
A generic function, or polymorphic function as it is sometimes called, is one whose implementation depends on the types of its arguments.
For example, C++ provides mechanisms for user-defined compile time and run-time polymorphic functions, but Fortran does not provide any means for user-defined polymorphic operators.
This means that the checking rule will perform significantly better on polymorphic function types such as All (X) () [right arrow] (X [right arrow] X), where the result type mentions a polymorphic variable in both positive and negative positions.
The ability to eliminate variables in this way is a crucial reason for choosing the "Kernel" variant of F [is less than is equal] rather than the "full F [is less than is equal to]" variant where two polymorphic function types with different upper bounds for their type components are allowed to stand in the subtype relation under appropriate conditions; in the latter system, it can be shown that variables cannot always be eliminated in a most general way [Ghelli and Pierce 1998].
Polymorphic functions are written [Lambda][Alpha].e, where [Alpha] is the abstracted type, and e is the body of the polymorphic function.
In the absence of polymorphic functions, our approach to typing closure conversion is based on Minamide et al.
Such a function specifies a form of type-safe dynamic type dispatch, wherein a polymorphic function dispatches at run-time on the basis of type arguments.
The rule demonstrates that the typerec defines a polymorphic function of type [inverted]A[Alpha] [is less than]: [Rho].[Sigma] The kind constraint on [Alpha] restricts the domain of applicability of this function, to types for which the cases in dynamic type dispatch are defined.
Algorithm S does not attempt to find the right type schemes of polymorphic functions
. Algorithm R, on the other hand, generates no new variables, but uses Mycroft iteration to resolve the type schemes of recursive functions.