-
Notifications
You must be signed in to change notification settings - Fork 52
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
Dynamic layout for inexhaustive case/indeterminately match case #1125
base: dev
Are you sure you want to change the base?
Conversation
@@ -271,7 +272,11 @@ let rec dhexp_of_uexp = | |||
| InHole( | |||
InexhaustiveMatch(Some(Common(Inconsistent(Internal(_))))), | |||
) => | |||
// TODO: review |
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.
Not problematic for now since currently DHExp.InexhaustiveCase
behaves exactly the same as DHExp.InconsistentBranches
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 comment -- I think we can unify the case constructs here rather than implementing a third variant
@@ -33,6 +33,7 @@ module rec DHExp: { | |||
| Prj(t, int) | |||
| Constructor(string) | |||
| ConsistentCase(case) | |||
| InexhaustiveCase(MetaVar.t, HoleInstanceId.t, case) |
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.
Instead of having three different case constructs in DHExp, let's merge them into one with an additional flag parameter for when there is an error.
@pigumar1 I don't recall the precise purpose of this PR -- what is it and what is the status? |
@cyrus- I have updated the purpose of this PR at the top. The expected behavior has already been implemented, but some code simplifications can be done, as suggested by the comment above. #1154 was introduced for this code simplification, but it has its own relevant concerns, which are mentioned at the top of that PR. |
This pull request implements the functionality of visually crossing out mismatched rules during evaluation. It's possible for the evaluation of an indeterminately exhaustive case expression to get stuck when we cannot determine whether a rule is matched or mismatched. In this case, the rules preceding this rule are crossed out.