-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Extended Syntax: case hoisting #90
Conversation
|
||
{- | ||
IDEA: | ||
If Alt had name then the HPT could calculate it's return type and store in TypeEnv |
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.
Alt has a name now. Maybe create an issue about it?
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.
Well, currently HPT tracks the alt name as a restricted version of the scrutinee. I will create an issue just for tracking this.
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.
See #94
(freshAlt2, _) <- case cpat2 of | ||
DefaultPat -> refreshNames nameMap alt2 | ||
_ -> refreshNames nameMap $ EBind (SReturn $ Var freshLPatName) (VarPat altName2) alt2 | ||
(freshAlt2, _) <- refreshNames nameMap $ |
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.
What was the problem here?
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.
Now the default alt also has a name. It has to be rebound when hoisting the default alt into some other alt. See the default pattern
test case.
See #32