-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
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
Allow ..Nothing to resolve to Nothing #9746
Allow ..Nothing to resolve to Nothing #9746
Conversation
Benchmarks run scheduled. |
group_builder.specify "Autoscope Nothing" <| | ||
accept (n:Nothing) = n | ||
|
||
accept ..Nothing . is_nothing . should_be_true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok but I think I missed why we want to allow that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses #9738. The
introduced the ..Constructor
syntax. In case of singletons like Nothing
or Pavel
(in the example below), the type is de-factor its own constructor. Thus it make sense to support ..Nothing
or ..Pavel
syntax of autoscoped constructors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to work also for other types than Nothing
? For example:
from Standard.Base import Date
main =
..Date == Date
```?
This example yields from Standard.Base import Date
materialize (d:Date) = d
main =
d = materialize ..Date
d == Date Then one gets Cannot find constructor ..Date among Date. It is all supposed to work only for singletons. Following program returns type Pavel
materialize (d:Pavel) = d
main =
d = materialize ..Pavel
d == Pavel |
Pull Request Description
Fixes #9738 in a different way than #9743.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Java,