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

Dynamic layout for inexhaustive case/indeterminately match case #1125

Draft
wants to merge 23 commits into
base: dev
Choose a base branch
from

Conversation

pigumar1
Copy link
Contributor

@pigumar1 pigumar1 commented Oct 22, 2023

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.
image

@pigumar1 pigumar1 self-assigned this Oct 22, 2023
@pigumar1 pigumar1 marked this pull request as draft October 22, 2023 17:16
@@ -271,7 +272,11 @@ let rec dhexp_of_uexp =
| InHole(
InexhaustiveMatch(Some(Common(Inconsistent(Internal(_))))),
) =>
// TODO: review
Copy link
Contributor Author

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

@cyrus- cyrus- marked this pull request as ready for review November 10, 2023 05:38
Copy link
Member

@cyrus- cyrus- left a 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)
Copy link
Member

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.

@cyrus- cyrus- added the needs-polish for PRs that are substantially complete but need final polish label Nov 18, 2023
@cyrus- cyrus- marked this pull request as draft November 18, 2023 20:37
Base automatically changed from haz3l-case-redundancy to haz3l-case-exhaustiveness February 13, 2024 17:58
Base automatically changed from haz3l-case-exhaustiveness to dev May 19, 2024 23:34
@cyrus-
Copy link
Member

cyrus- commented Jul 25, 2024

@pigumar1 I don't recall the precise purpose of this PR -- what is it and what is the status?

@pigumar1
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-polish for PRs that are substantially complete but need final polish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants