Skip to content

Improve performances of type substitutions.

Kim Nguyễn requested to merge subst-and-positive-perfs into dev

This patch improves the performances of type substitutions and of operations that needs to translate types back to a syntactic equations. Several improvements are made:

  • Internally, a GADT is used instead of polymorphic variants to represent recursive type equations. It helped remove a few inconsistencies and will allow further optimizations.

  • Recursive equations are hashconsed, improving sharing of common subtrees in the type. This impacts the test suite as it may change the pretty printing of types with shared subtrees as well as the order of some unioned elements.

  • Specifically for type substitutions, when the variables of a subtree in the types are disjoints from the domain of the substitution, do not recurse into it.

Merge request reports