Parmatch: introduce a type for simplified pattern heads#8766
Parmatch: introduce a type for simplified pattern heads#8766trefis merged 4 commits intoocaml:trunkfrom
Conversation
stedolan
left a comment
There was a problem hiding this comment.
Looks good! Glad to see a bunch of assert false go away.
Octachron
left a comment
There was a problem hiding this comment.
I like the code. Nevertheless, I have some small minor nitpicking remarks. In particular, the code often uses names of the form d... for pattern head variables. Could we use more mnemonic names? Like h.. as a shorthand for head (which is also used) for instance?
| ; typ = Ctype.none | ||
| ; env = Env.empty | ||
| ; attributes = [] | ||
| } |
There was a problem hiding this comment.
Minor nitpicking: why not use make at this point?
|
Note from a brief discussion with @trefis. In a future PR it might be worth adding a version of |
|
I have thought about extending the notion of head to or-patterns (which may have several heads). One property that we lose as soon as we leave the fragment of simple patterns is the equivalence between So I think that rather than extending |
|
@Octachron I updated as you suggested. I'll clean up the history and merge later today.
I believe that is what @lpw25 was suggesting. |
|
Ah, I realize I forgot to answer:
|
|
I pushed some minor renaming along these lines, but things were mostly OK IMO. |
|
The renamings look nice (in particular in |
|
I rebased and cleaned up the history. |
Parmatch: introduce a type for simplified pattern heads
This is a mostly mechanical change, that has been a long time coming.
I think @lpw25 is a good candidate to review this, given that he too had wanted to implement this (or a similar) idea for a long time.