Module Patterns.Head

type desc =
  1. | Any
  2. | Construct(Types.constructor_description)
  3. | Constant(Asttypes.constant)
  4. | Tuple(int)
  5. | Record(list(Types.label_description))
  6. | Variant of {
    1. tag: Asttypes.label,
    2. has_arg: bool,
    3. cstr_row: Stdlib.ref(Types.row_desc),
    4. type_row: unit => Types.row_desc,
    }
  7. | Array(int)
  8. | Lazy
;
let arity: t => int;
let deconstruct: Simple.pattern => (t, list(Typedtree.pattern));

deconstruct p returns the head of p and the list of sub patterns.

  • raises [Invalid_arg

    _] if p is an or- or an exception-pattern.

let to_omega_pattern: t => Typedtree.pattern;

reconstructs a pattern, putting wildcards as sub-patterns.

let omega: t;