The problem statement, for reference:
Consider a datatype definition that introduces numeric lists as the sum of two variants:
nempty
andncons
. This defines a new type (nlist
), and each constructor (such asncons
) creates a value of that type. As a result, however, selectors (such asnfirst
) cannot statically determine whether or not they have been given the correct variant of the datatype, and must rely on a check from the run-time system. >