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

pattern-matching refactoring: keep going #9447

Merged
merged 5 commits into from
Apr 16, 2020
Merged

Conversation

gasche
Copy link
Member

@gasche gasche commented Apr 14, 2020

This is the next bit of the big pattern-matching refactoring change (#9321) after #9417 has been merged. This one is a series of small commits that iterate simple refactorings; they should be reviewed independently.

(Internal: there was a bit of rebase work due to the (nice!) change of arguments of the split_and_precompile_* function from args to ~arg suggested by @Octachron during the review of #9322.)

lambda/matching.ml Outdated Show resolved Hide resolved
Copy link
Member

@Octachron Octachron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refactoring look good overall:

  1. Restricting the return type of what_is_cases seems more natural
  2. Moving the preprocessing logic out of the split_and_precompile function seems to work
  3. Reusing compile_match_nonempty in compile_match is a clear win.
  4. The new function is quite clearer.

@gasche gasche merged commit 9f95355 into ocaml:trunk Apr 16, 2020
@gasche
Copy link
Member Author

gasche commented Apr 16, 2020

Merged, thanks! I'll try to send the next PR of the stack soon, and also work on do_for_multiple_match in parallel.

gasche added a commit to trefis/ocaml that referenced this pull request May 2, 2020
gasche added a commit to trefis/ocaml that referenced this pull request Jun 7, 2020
This comes from a suggestion by Florian Angeletti in
  ocaml#9447 (comment)
gasche added a commit to trefis/ocaml that referenced this pull request Jun 8, 2020
This comes from a suggestion by Florian Angeletti in
  ocaml#9447 (comment)
gasche added a commit to trefis/ocaml that referenced this pull request Jul 9, 2020
This comes from a suggestion by Florian Angeletti in
  ocaml#9447 (comment)
gasche added a commit to gasche/ocaml that referenced this pull request Nov 18, 2020
This comes from a suggestion by Florian Angeletti in
  ocaml#9447 (comment)
gasche added a commit to trefis/ocaml that referenced this pull request Nov 21, 2020
This comes from a suggestion by Florian Angeletti in
  ocaml#9447 (comment)
anmonteiro pushed a commit to melange-re/melange-compiler-libs that referenced this pull request Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants