package dolmen

  1. Overview
  2. Docs

Module Builtin.AdtSource

Sourcetype _ t =
  1. | Tester : {
    1. adt : 'ty_cst;
    2. case : int;
    3. cstr : 'term_cst;
    } -> < ty_cst : 'ty_cst ; term_cst : 'term_cst.. > t
    (*

    Tester { adt; cstr; case; } is the tester of the case-th constructor of type adt which should be cstr.

    *)
  2. | Constructor : {
    1. adt : 'ty_cst;
    2. case : int;
    } -> < ty_cst : 'ty_cst.. > t
    (*

    Constructor { adt; case} is the case-th constructor of the algebraic datatype defined by adt.

    *)
  3. | Destructor : {
    1. adt : 'ty_cst;
    2. case : int;
    3. cstr : 'term_cst;
    4. field : int;
    } -> < ty_cst : 'ty_cst ; term_cst : 'term_cst.. > t
    (*

    Destructor { adt; cstr; case; field; } is the destructor returning the field-th argument of the case-th constructor of type adt which should be cstr.

    *)