On 7/26/2013 10:27 PM, Gabriel Scherer wrote:A feature request related to allowing more kinds of types to be refined by GADT patterns (abstract types in the current environment, introduced by unpacking a module -- but the same would be useful for abstract types in a functor's argument):
This is explained in the manual (emphasis mine)
http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#toc85
The constraints associated to each constructor can be recovered through pattern-matching.
Namely, **if the type of the scrutinee of a pattern-matching contains a locally abstract type**,
this type can be refined according to the constructor used.
The only types that can be refined by the type equalities introduced
by GADT are locally abstract types, the variable-like constructor "a"
introduced by the "(type a)" and "foo : type a . bar" syntaxes. Your
first two examples have no locally abstract type, only type members of
modules, so there was no GADT refinement happening.
http://caml.inria.fr/mantis/view.php?id=5713
-- Alain