Skip to content
Success

Changes

Summary

  1. matching: use constructor descriptions instead of tags as matching keys (commit: d333ac8) (details)
  2. Matching: propagate constructor descriptions in complete_pats_constrs (commit: bf95a24) (details)
Commit d333ac83ecc94be4af7933c39c905025da201940 by gabriel.scherer
matching: use constructor descriptions instead of tags as matching keys

This loses no information (descriptions contain the tag), but it will
make it easier to obtain the descriptions inside `combine_constructor`
without doing a dynamic check on the patterns. This will in turn help
simplify the interaction with `Parmatch.complete_constrs`.

Note: after this patch we use `Types.equal_tag` instead of `( = )` to
compare tags during pattern-matching compilation. This is better code,
and we believe that it does not change the behavior: `Types.equal_tag`
is mostly similar to a type-specialized version of `( = )`, except
that it calls `Ident.same` that just compares the stamps and ignore
the names, which (assuming well-formedness of idents) is equivalent
and slightly faster.
(commit: d333ac8)
The file was modifiedlambda/matching.ml (diff)
Commit bf95a247395ef89036578e04194e517063eb1244 by gabriel.scherer
Matching: propagate constructor descriptions in complete_pats_constrs

This simplifies this particular interface boundary between Matching
and Parmatch.

(Suggested by Florian Angeletti)
(commit: bf95a24)
The file was modifiedtyping/parmatch.ml (diff)
The file was modifiedChanges (diff)
The file was modifiedlambda/matching.ml (diff)
The file was modified.depend (diff)
The file was modifiedtyping/parmatch.mli (diff)