Module Sstt.Printer

module NodeId : sig ... end
type builtin =
  1. | Empty
  2. | Any
  3. | AnyTuple
  4. | AnyEnum
  5. | AnyTag
  6. | AnyInt
  7. | AnyArrow
  8. | AnyRecord
  9. | AnyTupleComp of int
  10. | AnyTagComp of Tag.t
type 'c t' = {
  1. main : 'c descr';
  2. defs : 'c def' list;
}
and 'c def' = NodeId.t * 'c descr'
and 'c descr' = {
  1. op : 'c op';
  2. ty : Ty.t;
}
and 'c op' =
  1. | Custom of 'c
  2. | Alias of string
  3. | Node of NodeId.t
  4. | Builtin of builtin
  5. | Var of Var.t
  6. | Enum of VDescr.Descr.Enums.Atom.t
  7. | Tag of Tag.t * 'c descr'
  8. | Interval of Z.t option * Z.t option
  9. | Record of (Label.t * 'c descr' * bool) list * bool
  10. | Varop of Prec.varop * 'c descr' list
  11. | Binop of Prec.binop * 'c descr' * 'c descr'
  12. | Unop of Prec.unop * 'c descr'
type t = (module CustomNode) t'
type descr = (module CustomNode) descr'
type def = (module CustomNode) def'
type op = (module CustomNode) op'
type ('u, 'l, 'r) cparam =
  1. | PUnprocessed of 'u
  2. | PLeaf of 'l
  3. | PRec of 'r
type ('u, 'l, 'r) cparams = {
  1. pid : int list;
  2. pdef : ('u, 'l, 'r) cparam list;
}
type custom =
  1. | CDef of NodeId.t * (Ty.t, descr, custom) cparams list
  2. | CNode of NodeId.t
type extracted_params = (Ty.t, Ty.t, Ty.t) cparams list
type aliases = (Ty.t * string) list
type extensions = (module PrinterExt) list
type params = {
  1. aliases : aliases;
  2. extensions : extensions;
}
val cup_descr : descr -> descr -> descr
val cap_descr : descr -> descr -> descr
val neg_descr : descr -> descr
val empty_params : params
val merge_params : params list -> params
val get : params -> Ty.t -> t

get aliases ty transforms the type ty into an algebraic form, recognizing type aliases aliases.

val print : Stdlib.Format.formatter -> t -> unit

print fmt t prints the algebraic form t using formatter fmt.

val print_descr : Stdlib.Format.formatter -> descr -> unit

print_descr fmt d prints the printer descriptor d using formatter fmt.

val print_descr_atomic : Stdlib.Format.formatter -> descr -> unit

print_descr_atomic fmt d prints the printer descriptor d in an atomic way (adding parentheses if necessary) using formatter fmt.

val print_descr_ctx : int -> Prec.assoc -> Stdlib.Format.formatter -> descr -> unit

print_descr_ctx prec assoc fmt d prints the printer descriptor d in a context with precedence prec and associativity assoc, using formatter fmt.

val print_ty : params -> Stdlib.Format.formatter -> Ty.t -> unit

print_ty aliases fmt ty prints the type ty using formatter fmt, recognizing type aliases aliases. Same as print fmt (get aliases ty).

val print_subst : params -> Stdlib.Format.formatter -> Subst.t -> unit

print_subst aliases fmt s prints the substitution s using formatter fmt, recognizing type aliases aliases.

val print_ty' : Stdlib.Format.formatter -> Ty.t -> unit

print_ty' fmt ty prints the type ty using formatter fmt. Same as print_ty [] fmt ty.

val print_subst' : Stdlib.Format.formatter -> Subst.t -> unit

print_subst' fmt s prints the substitution s using formatter fmt. Same as print_subst [] fmt s.