We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It should be trivial to create a nominal type from another type.
E.g.
type Year wraps Num
In this case this would be fine:
def before |y: Year| y < 2023 let y: Year = 1991 in before y -- true
This would not be fine:
def before |y: Year| y < 2023 let y = 1991 in before y -- type mismatch, ideally with a hint about requiring an explicit annotation
And equally:
def add |x: Num, y: Num| y < 2023 let y: Year = 1991 in add 4 y -- type mismatch, with a hint about requiring an explicit annotation
(Note: the type X wraps Y syntax is bad and should be improved, but type X = Y looks like an alias rather than a newtype).
type X wraps Y
type X = Y
(Also note: overloading ascryption for this might be a bad idea.)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It should be trivial to create a nominal type from another type.
E.g.
In this case this would be fine:
This would not be fine:
And equally:
(Note: the
type X wraps Y
syntax is bad and should be improved, buttype X = Y
looks like an alias rather than a newtype).(Also note: overloading ascryption for this might be a bad idea.)
The text was updated successfully, but these errors were encountered: