elpi

ELPI - Embeddable λProlog Interpreter
Library elpi
Module Elpi . API . RawOpaqueData
type name = string
type doc = string
type t
type 'a declaration = 'a OpaqueData.declaration = {
name : name;
doc : doc;
pp : Format.formatter -> 'a -> unit;
compare : 'a -> 'a -> int;
hash : 'a -> int;
hconsed : bool;
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 {
cin : 'a -> Data.term;
isc : t -> bool;
cout : t -> 'a;
name : string;
}
val declare : 'a declaration -> 'a cdata * 'a Conversion.t
val pp : 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