Skip to content
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

Merged
merged 5 commits into from
Apr 19, 2020
Merged

Conversation

Anabra
Copy link
Member

@Anabra Anabra commented Apr 10, 2020

See #32

@Anabra Anabra added the review Ready for review label Apr 10, 2020
@Anabra Anabra requested review from csabahruska and andorp April 10, 2020 13:59
@Anabra Anabra self-assigned this Apr 10, 2020

{-
IDEA:
If Alt had name then the HPT could calculate it's return type and store in TypeEnv
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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 $
Copy link
Member

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?

Copy link
Member Author

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.

@Anabra Anabra merged commit 0c622bd into 32-extended-syntax Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants