Module Parmatch
Detection of partial matches and unused match cases.
val omega : Typedtree.patternaka. "Tpat_any" or "_"
val omegas : int -> Typedtree.pattern listList.init (fun _ -> omega)
val omega_list : 'a list -> Typedtree.pattern listList.map (fun _ -> omega)
val normalize_pat : Typedtree.pattern -> Typedtree.patternKeep only the "head" of a pattern: all arguments are replaced by
omega, so are variables.
val const_compare : Asttypes.constant -> Asttypes.constant -> intconst_compare c1 c2compares the actual values represented byc1andc2, while simply usingStdlib.comparewould compare the representations.cf. MPR#5758
val le_pat : Typedtree.pattern -> Typedtree.pattern -> boolle_pat p qmeans: forall V, V matches q implies V matches p
val le_pats : Typedtree.pattern list -> Typedtree.pattern list -> boolle_pats (p1 .. pm) (q1 .. qn)means: forall i <= m,le_pat pi qi
module Compat : functor (Constr : sig ... end) -> sig ... endExported compatibility functor, abstracted over constructor equality
val lub : Typedtree.pattern -> Typedtree.pattern -> Typedtree.patternlub p qis a pattern that matches all values matched bypandq. May raiseEmpty, whenpandqare not compatible.
val lubs : Typedtree.pattern list -> Typedtree.pattern list -> Typedtree.pattern listlubs [p1; ...; pn] [q1; ...; qk], wheren < k, is[lub p1 q1; ...; lub pk qk].
val get_mins : ('a -> 'a -> bool) -> 'a list -> 'a listval set_args : Typedtree.pattern -> Typedtree.pattern list -> Typedtree.pattern listThose two functions recombine one pattern and its arguments: For instance: (_,_)::p1::p2::rem -> (p1, p2)::rem The second one will replace mutable arguments by '_'
val set_args_erase_mutable : Typedtree.pattern -> Typedtree.pattern list -> Typedtree.pattern listval pat_of_constr : Typedtree.pattern -> Types.constructor_description -> Typedtree.patternval complete_constrs : Typedtree.pattern -> Types.constructor_tag list -> Types.constructor_description listval ppat_of_type : Env.t -> Types.type_expr -> Parsetree.pattern * (string, Types.constructor_description) Stdlib.Hashtbl.t * (string, Types.label_description) Stdlib.Hashtbl.tppat_of_typebuilds an untyped or-pattern from its expected type. May raiseEmptywhentype_expris an empty variant
val pressure_variants : Env.t -> Typedtree.pattern list -> unitval check_partial : ((string, Types.constructor_description) Stdlib.Hashtbl.t -> (string, Types.label_description) Stdlib.Hashtbl.t -> Parsetree.pattern -> Typedtree.pattern option) -> Location.t -> Typedtree.case list -> Typedtree.partialval check_unused : (bool -> (string, Types.constructor_description) Stdlib.Hashtbl.t -> (string, Types.label_description) Stdlib.Hashtbl.t -> Parsetree.pattern -> Typedtree.pattern option) -> Typedtree.case list -> unitval irrefutable : Typedtree.pattern -> boolval inactive : partial:Typedtree.partial -> Typedtree.pattern -> boolAn 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 check_ambiguous_bindings : Typedtree.case list -> unitval some_private_tag : Asttypes.label