Module Meta.Schema

External context schemas.

type t =
  1. | Constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constant { identifier = "ctx"; _ } is the schema having identifier "ctx" declared elsewhere in the signature.

    A tuple term has a block type t matching against this schema if t matches against the schema referred to as `identifier'.

    *)
  2. | Alternation of {
    1. location : Syncom.Location.t;
    2. schemas : t Support.List2.t;
    }
    (*

    Alternation { schemas = [g1; g2; ...; gn]; _ } is the schema g1 + g2 + ... + gn.

    A tuple term has a block type t matching against this schema if t matches against at least one of g1, g2, ..., gn.

    *)
  3. | Element of {
    1. location : Syncom.Location.t;
    2. some : (Syncom.Identifier.t * Synext__.Synext_definition.LF.Typ.t) Support.List1.t Support.Option.t;
    3. block : [ `Unnamed of Synext__.Synext_definition.LF.Typ.t | `Record of (Syncom.Identifier.t * Synext__.Synext_definition.LF.Typ.t) Support.List1.t ];
    }
    (*
    • Element { some = [("x1", p1); ("x2", p2); ...; ("xn", pn)]; block = `Unnamed t; _ } is the schema some [x1 : p1, x2 : p2, ..., xn : pn] block t.
    • Element { some = [("x1", p1); ("x2", p2); ...; ("xn", pn)]; block = `Record [("y1", q1); ("y2", q2); ...; ("yn", qn)]; _ } is the schema some [x1 : p1, x2 : p2, ..., xn : pn] block (y1 : q1, y2 : q2, ..., yn : qn).

    A tuple term has a block type t matching against this schema if there exist terms having types in p in the context, and if the elements in t match against those in q.

    *)