You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The whole data definition is a pattern in the rest of the module, but the variable a should scope locally over the value constructors which are themselves in scope in the rest of the module.
If we were working with terms, we'd just use a Bind to introduce a scope so that the a ranged over the value constructors.
But since NONE and SOME are constructor names that scope over the rest of the module, what we actually want is to use a LocalBind as a pattern. (This is in some sense a complement to Shift which is all about lifting terms out of scopes whereas this would be limiting the scope of a pattern)
The text was updated successfully, but these errors were encountered:
Consider implementing SML data type definitions:
The whole data definition is a pattern in the rest of the module, but the variable
a
should scope locally over the value constructors which are themselves in scope in the rest of the module.If we were working with terms, we'd just use a
Bind
to introduce a scope so that thea
ranged over the value constructors.But since
NONE
andSOME
are constructor names that scope over the rest of the module, what we actually want is to use aLocalBind
as a pattern. (This is in some sense a complement toShift
which is all about lifting terms out of scopes whereas this would be limiting the scope of a pattern)The text was updated successfully, but these errors were encountered: