const_compare c1 c2 compares the actual values represented by
c2, while simply using
Stdlib.compare would compare the representations.
le_pat p q means: forall V, V matches q implies V matches p
le_pats (p1 .. pm) (q1 .. qn) means: forall i <= m,
le_pat pi qi
Exported compatibility functor, abstracted over constructor equality
lub p q is a pattern that matches all values matched by
q. May raise
q are not compatible.
lubs [p1; ...; pn] [q1; ...; qk], where
n < k, is
[lub p1 q1; ...; lub pk qk].
Those two functions recombine one pattern and its arguments: For instance: (_,_)::p1::p2::rem -> (p1, p2)::rem The second one will replace mutable arguments by '_'
ppat_of_type builds an untyped pattern from its expected type, for explosion of wildcard patterns in Typecore.type_pat.
There are four interesting cases:
- the type is empty (
- no further explosion is necessary (
- a single pattern is generated, from a record or tuple type or a single-variant type (
- an or-pattern is generated, in the case that all branches are GADT constructors (
val check_partial : ( ( string, Types.constructor_description ) Hashtbl.t -> ( string, Types.label_description ) Hashtbl.t -> Parsetree.pattern -> Typedtree.pattern option ) -> Location.t -> Typedtree.value Typedtree.case list -> Typedtree.partial
check_partial pred loc caselist and
check_unused refute pred caselist are called with a function
pred which will be given counter-example candidates: they may be partially ill-typed, and have to be type-checked to extract a valid counter-example.
pred returns a valid counter-example or
refute indicates that
check_unused was called on a refutation clause.
val irrefutable : Typedtree.pattern -> bool
An inactive pattern is a pattern, matching against which can be duplicated, erased or delayed without change in observable behavior of the program. Patterns containing (lazy _) subpatterns or reads of mutable fields are active.
val some_private_tag : Asttypes.label