package elpi

  1. Overview
  2. Docs

Low level module for OpaqueData

type name = string
type doc = string
type t
type 'a declaration = 'a OpaqueData.declaration = {
  1. name : name;
  2. doc : doc;
  3. pp : Stdlib.Format.formatter -> 'a -> unit;
  4. compare : 'a -> 'a -> int;
  5. hash : 'a -> int;
  6. hconsed : bool;
  7. constants : (name * 'a) list;
}

If the data_hconsed is true, then the cin function below will automatically hashcons the data using the eq and hash functions.

type 'a cdata = private {
  1. cin : 'a -> Data.term;
  2. isc : t -> bool;
  3. cout : t -> 'a;
  4. name : string;
}
val declare : 'a declaration -> 'a cdata * 'a Conversion.t
val pp : Stdlib.Format.formatter -> t -> unit
val show : t -> string
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val name : t -> string
val hcons : t -> t
val ty2 : 'a cdata -> t -> t -> bool
val morph1 : 'a cdata -> ('a -> 'a) -> t -> Data.term
val morph2 : 'a cdata -> ('a -> 'a -> 'a) -> t -> t -> Data.term
val map : 'a cdata -> 'b cdata -> ('a -> 'b) -> t -> Data.term
val int : int cdata
val is_int : t -> bool
val to_int : t -> int
val of_int : int -> Data.term
val float : float cdata
val is_float : t -> bool
val to_float : t -> float
val of_float : float -> Data.term
val string : string cdata
val is_string : t -> bool
val to_string : t -> string
val of_string : string -> Data.term
val loc : Ast.Loc.t cdata
val is_loc : t -> bool
val to_loc : t -> Ast.Loc.t
val of_loc : Ast.Loc.t -> Data.term
OCaml

Innovation. Community. Security.