a simple, short refactoring of lambda/Matching.do_compile_matching#13342
Merged
gasche merged 1 commit intoocaml:trunkfrom Jul 31, 2024
Merged
a simple, short refactoring of lambda/Matching.do_compile_matching#13342gasche merged 1 commit intoocaml:trunkfrom
gasche merged 1 commit intoocaml:trunkfrom
Conversation
Member
|
It looks correct to me and this is a clear improvement in terms of readability. |
Member
Author
|
This needs the approval of a maintainer to move forward. |
yallop
approved these changes
Jul 31, 2024
| (compile_match ~scopes repr partial) | ||
| partial divide combine ctx pm | ||
| in | ||
| let open Patterns.Head in |
Member
There was a problem hiding this comment.
Suggested change
| let open Patterns.Head in |
This local open isn't needed here and made the change slightly harder to review.
Member
Author
There was a problem hiding this comment.
I think that the person who wrote this open (probably me?) wanted to avoid relying on type-based disambiguation of constructors that are not in the lexical scope, a feature I still have mixed feelings about. I'll go with the easiest option of changing nothing at all here.
Member
Author
|
Thanks @zapashcanon and @yallop! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This refactoring-only PR shares about 5 common arguments between 8 different function calls inside the pattern-matching compiler. This makes it sensibly easier to tweak the arguments passed to pattern-matching compilation (in the context of The Pattern-Matching Bug). This commit was extracted from #13154. It is short and requires no domain-specific knowledge, so it should be easy to review.