Module Ppx_elpiSource

This PPX deriver can synthesize glue code for Elpi. The following kind of data types are supported:

The type must come with a pretty printer named following the usual convention (named pp if the type is named t, pp_ty otherwise). Using both @@deriving show, elpi on each data type is the simplest option (show is the one from ppx_deriving, hence preprocess with (pps ppx_deriving.show ppx_elpi)). See also @@elpi.pp.

Example of a HOAS data type

type lctx = | Entry of (string@elpi.key "term") * ty @@elpi.index (module String) @@deriving show, elpi

type term = | Lam of string * ty * (term@elpi.binder "term" lctx (fun s ty -> Entry(s,ty))) | Var of string @elpi.var lctx @@deriving show, elpi

Output (for term):

class type ctx_for_term = object inherit Elpi.API.PPX.ctx method lctx : lctx Elpi.API.PPX.ctx_field end val term : 'c 'csts. (term, #ctx_for_term as 'c, 'csts) ContextualConversion.t val in_ctx_for_term : (ctx_for_term, 'csts) ContextualConversion.ctx_readback

Usage: predicates using HOAS arguments must specify a context large enough for all arguments. They are declared with ContextualPred, whose FFI is BuiltInPredicate.PPX.ffi (it has the constructors of the FFI of Pred, but the conversions of the arguments are contextual).

ContextualPred("term->string", in_ctx_for_term, In(term, "T", Out(BuiltInData.stringC, "S", Read("what else"))), fun (x : term) _ ~depth:_ (c : ctx_for_term) (_ : Data.constraints) (_ : State.t) -> ... x ... c#lctx ...)

Here in_ctx_for_term is a context rich enough to support the readback of data of type term and string.

In Elpi the context type is not a data type: each of its constructors is declared as builtin func entry term -> string, ty. that is, a function from the bound variable (of the type given by @elpi.key "term") to all the fields of the constructor, in order. The entry of a variable is a rule of that function, added under the binder (eg entry x "x" tt ==> ...).

Several data under different contexts

A predicate has a single context, hence one taking in input data of types t1 and t2 living under different contexts needs a context rich enough for both. The structure item

%%elpi.compose_ctx both [t1; t2]

defines it, given that t1 and t2 are derived (with a context each, say c1 and c2, see above). It expands to

class ctx_for_both : Data.hyps -> Data.state -> object inherit ctx_for_t1 inherit ctx_for_t2 end val in_ctx_for_both : (ctx_for_both,'csts) ContextualConversion.ctx_readback

where in_ctx_for_both reads back the context of t1, then the one of t2, and builds the object. The predicate then declares in_ctx_for_both as its context and gets, in the object it receives, the methods c1 and c2:

ContextualPred("t1->t2->string", in_ctx_for_both, In(t1, "A", In(t2, "B", Out(string, "S", Read("...")))), fun (a : t1) (b : t2) _ ~depth:_ c _ _ -> ... c#c1 ... c#c2 ...)

The list must contain at least one type, and the types are read back in the order they are listed. A context shared by several of them is read back once for each (the result is the same). See test_compose_contextual.ml.

Deriving directives: @@deriving elpi Derive a Elpi.API.ContextualConversion.t for the data types in the mutually recursive block. The name of the conversion is the one of the type. See the Conventions section of this doc for more info on the naming of generated code. @@deriving elpi { context = [ty1; ...; tyn]} Specify the types describing the context under which the data type lives and the order in which they should be read back. Default is the list of types mentioned in @elpi.binder and @elpi.var, in no specified order. @@deriving elpi { declaration = l } Also add to l (made by Elpi.API.PPX.empty_declaration ()) the MLDataC declarations that were derived, each one followed by the LPCode of its deep copy function (see below). Elpi.API.PPX.to_list l returns them in the order they were added.

Deep copy:

For each data type ty (but not for context types) the string elpi__ty__deep_copy contains the Elpi code of a deep copy function, eg func ty.copy ty -> ty. (with a copy function for each parameter if the type is a container, eg func t.copy (func X -> Y), t X -> t Y). The LPCode of this string is added to the list passed as { declaration = l }. The copy is the identity, it is up to the user to place his code before it and override the cases he wants in order to implement a non trivial copy (eg a substitution). The elements of lists are copied by list.copy, the ones of the other containers in the standard library by option.copy, pair.copy, triple.copy and quadruple.copy, and the fields of any other type by the function ty.copy, that is assumed to exist (it does for the types of the standard library, eg int.copy, and for the types derived by this ppx; ty is the default Elpi name of the type, hence a type with a custom name given by @@elpi.type_code is only found if it is derived in the same block). A type abbreviation is copied as its definition is, and an opaque type is copied by the identity. A field below a binder is copied under the binder, in the context extended with the entry for the bound variable, which is copied to itself: pi x\ entry x B0 ==> term.copy x x ==> term.copy (A1 x) (B1 x) where entry is the constructor built by the function of the binder (it must have the shape fun p1 ... pn -> C (e1, ..., ek) with the ei among the pi, otherwise no entry is added to the context), B0 is the copy of the field that is the argument of the function and term is the type of the bound variable (the first argument of @elpi.binder), that must come with its copy function. The variables that are not bound by the data being copied are not copied by the generated rules: the user has to add the rule, eg term.copy x x ==> ..., for the ones that occur in the data.

This code currently sucks, it generates a string and not an AST.

Type attributes:

@@elpi.pp f f mandatory: code for pretty printing the data. Its type is the one ppx_deriving.show would produce.

@@elpi.type_code "name" "code" name mandatory: a string, the name of the type in Elpi. The default is the name of the OCaml type in lowercase where _ is replaced by - . code optional: a string used as the Elpi kind declaration of the type (instead of the generated one).

@@elpi.type_doc s s mandatory: a string, a comment printed before the declaration of the type. By default there is none.

@@elpi.default_constructor_readback f f mandatory: a function of type Elpi.API.ContextualConversion.(readback -> readback) called when the term is not any of the constructors (variants and records only). Its argument is the default behavior, a runtime type error. This option can be used to read back flexible terms (in addition to regular constructors).

@@elpi.index (module M) M mandatory: is an OrderedType and Show, it is used to instantiate the functor Elpi.API.Utils.Map.Make. When used in a type, each constructors must have exactly one argument with attribute @elpi.key and that argument must be of type M.t.

@@elpi.opaque e e mandatory: is a Elpi.API.OpaqueData.declaration, it is necessary for opaque data types.

Constructor attributes:

@elpi.var ctx to_key An Elpi bound variable. ctx mandatory: is the name of the context in which the variable is bound. to_key optional: is a function from the constructor arguments to the value being the @elpi.key for the context ctx.

@elpi.skip Not exposed to Elpi.

@elpi.variant n The variant of the global symbol of the constructor. n mandatory: an integer literal, >= 1. Constructors with the same name (eg in different types) must have different variants, and the Elpi declaration is builtin symb name : ... = "n".

@elpi.embed f Custom embedding code. f mandatory: function of type Elpi.API.ContextualConversion.(embedding -> embedding) where the input function is the one this ppx would generate. If you want to override it only in some cases, just call this argument in the other ones.

@elpi.readback f Custom readback code. f mandatory: function of type Elpi.API.ContextualConversion.(readback -> readback) see @elpi.embed.

@elpi.code name code Custom Elpi declaration. name mandatory: a string that stands for the name of the constructor in Elpi. The default is the name of the OCaml constructor in lowercase where _ is replaced by - . Eg Foo_BAR becomes foo-bar. code optional: is a string used as the Elpi type declaration for the constructor. Default is derived from the types of the fields. Example "type lam (term -> term) -> term. % Lam"

@elpi.doc s Custom documentation. s mandatory: a string. Default doc is the name of the OCaml constructor, see the example above.

Constructor field attributes:

@elpi.key "ty" Field used as a key in the Map to values of this type. It can be any of the fields of the constructor. ty mandatory: name (string) of the elpi type of the variables bound by this context, eg the "term" in @elpi.binder "term" ctx .... If the type has parameters, a list of strings "term"; "A"; ...: the parameters are called A, B, C, ... in Elpi, in order. A constructor of the context is declared as builtin func name ty -> field1, ..., fieldN in Elpi (no data type).

@elpi.binder ty ctx mk_ctx_entry Field is below one binder. ty optional: name (string) of the elpi abstraction type, eg the "XXX" in (XXX -> term), or the list "XXX"; "A"; ... if the type has parameters. Default is the type name. ctx mandatory: name of the context in which the variable is bound mk_ctx_entry mandatory: function taking all other fields and returning a ctx entry (a value in the type ctx).

Extensions:

%elpi : ty the conversion of type ty This does not synthesize the conversion code but rather compose the existing ones.

%%elpi.compose_ctx name [ty1; ...; tyn] a context for several data Structure item generating the class ctx_for_<name> and the value in_ctx_for_<name>, a context in which data of type ty1, ..., tyn can all be read back even if they live under different contexts. See the section "Several data under different contexts" above.

Conventions:

<ty> is a value of type Elpi.API.ContextualConversion.t for type ty.

in_ctx_for_<ty> is a value of type Elpi.API.ContextualConversion.ctx_readback for type <ty>, and ctx_for_<ty> is the class type of the context it builds.

ctx_for_<name> and in_ctx_for_<name> are the class and the ctx_readback generated by %%elpi.compose_ctx name [...], same shape as the ones generated for a type.

Elpi_<ctx>_Map is a module of signature Elpi.API.Utils.Map.S built using Elpi.API.Utils.Map.Make(M) where type is annotated with @@elpi.index (module M).

Internal conventions:

Variables are named elpi__something so that they don't collide with any variable named elpi_something or something.

Sourceval att_elpi_tcode : (Ppxlib__.Import.type_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_tdoc : (Ppxlib__.Import.type_declaration, string) Ppxlib.Attribute.t
Sourceval att_elpi_def_k_readback : (Ppxlib__.Import.type_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_tpp : (Ppxlib__.Import.type_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_tindex : (Ppxlib__.Import.type_declaration, Ppxlib__.Import.module_expr) Ppxlib.Attribute.t
Sourceval att_elpi_tcdata : (Ppxlib__.Import.type_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_var : (Ppxlib__.Import.constructor_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_skip : (Ppxlib__.Import.constructor_declaration, unit) Ppxlib.Attribute.t
Sourceval att_elpi_embed : (Ppxlib__.Import.constructor_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_readback : (Ppxlib__.Import.constructor_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_code : (Ppxlib__.Import.constructor_declaration, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_variant : (Ppxlib__.Import.constructor_declaration, int) Ppxlib.Attribute.t
Sourceval att_elpi_doc : (Ppxlib__.Import.constructor_declaration, string) Ppxlib.Attribute.t
Sourceval att_elpi_key : (Ppxlib__.Import.core_type, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval att_elpi_binder : (Ppxlib__.Import.core_type, Ppxlib__.Import.expression) Ppxlib.Attribute.t
Sourceval elpi_name_mangle : string -> string
Sourceval elpi_map_name : string -> string
Sourceval elpi_state_name : string -> string
Sourceval elpi_ctx_class_module_name : string -> string
Sourceval elpi_ctx_class_name : string -> string
Sourceval elpi_ctx_object_name : string -> string
Sourceval deep_copy_name : string -> string
Sourceval elpi_readback_ctx_name : string -> string
Sourceval elpi_in_ctx_for_name : string -> string
Sourceval elpi_to_key : string -> string
Sourceval elpi_is_ctx_entry_name : string -> string
Sourceval elpi_embed_name : string -> string
Sourceval elpi_readback_name : string -> string
Sourceval elpi_push : string -> string
Sourceval elpi_pop : string -> string
Sourceval elpi_kname : string -> string -> string
Sourceval elpi_tname : string -> string
Sourceval elpi_kname_str : string -> string -> string
Sourceval elpi_tname_str : string -> string
Sourceval elpi_cdata_name : string -> string
Sourceval param_prefix : string
Sourceval fresh : unit -> string
Sourceval elpi_Map : loc:Ppxlib__.Location.t -> string -> string -> Ppxlib__.Import.expression
Sourceval option_is_some : 'a option -> bool
Sourceval option_get : 'a option -> 'a
Sourceval option_map : ('a -> 'b) -> 'a option -> 'b option
Sourceval option_default : 'a -> 'a option -> 'a
Sourceval option_to_list : 'a option -> 'a list
Sourceval filter_map : ('a -> 'b option) -> 'a list -> 'b list
Sourceval error : ?loc:??? -> ('a, Format.formatter, unit, 'b) format4 -> 'a
Sourceval nYI : loc:Ppxlib.Location.t -> __LOC__:string -> unit -> 'a
Sourceval elpi_loc_of_position : (module Ppxlib.Ast_builder.S) -> Lexing.position -> Ppxlib_ast.Ast.expression
Sourceval pexp_disable_warnings : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval on_last : ('a -> 'a) -> 'a list -> 'a list
Sourcetype codegen_directive =
  1. | Standard
  2. | Custom of {
    1. ml : Ppxlib.expression;
    2. pos : Ppxlib.position;
    }
  3. | Name of {
    1. get_key : Ppxlib.expression;
    2. ctx_name : string;
    }
Sourceval is_name : codegen_directive -> bool
Sourcetype arg_type =
  1. | FO of {
    1. key : string list option;
    2. readback : Ppxlib.expression;
    3. embed : Ppxlib.expression;
    4. ty_ast : Ppxlib.expression;
    5. ty : Ppxlib.core_type;
    }
  2. | HO of {
    1. ctx : string;
    2. build_ctx : Ppxlib.expression;
    3. arrow_src_elpi : string list;
    4. readback : Ppxlib.expression;
    5. embed : Ppxlib.expression;
    6. ty_ast : Ppxlib.expression;
    7. ty : Ppxlib.core_type;
    }
Sourceval parse_elpi_ty : loc:Ppxlib.Location.t -> Ppxlib.expression -> string list
Sourceval elpi_ty_ast : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib_ast.Ast.expression
Sourceval is_key : arg_type -> bool
Sourceval is_HO : arg_type -> bool
Sourceval ctx_index_ty : (module Ppxlib.Ast_builder.S) -> string list -> arg_type
Sourceval ctx_index_ty_of_args : (module Ppxlib.Ast_builder.S) -> arg_type list -> arg_type
Sourcetype elpi_constructor =
  1. | Skip of {
    1. constructor_name : string;
    2. has_args : bool;
    }
  2. | Expose of expose
Sourceand expose = {
  1. declaration : Ppxlib.structure_item list;
  2. constant : Ppxlib.expression;
  3. constant_name : string;
  4. variant : int;
  5. constructor : Ppxlib.expression list -> Ppxlib.expression;
  6. pattern : Ppxlib.pattern list -> Ppxlib.pattern;
  7. arg_types : arg_type list;
  8. embed : codegen_directive;
  9. readback : codegen_directive;
  10. elpi_code : Ppxlib.expression option;
  11. elpi_doc : string;
  12. ctx_names : string list;
}
Sourcetype elpi_type_decl =
  1. | Opaque of Ppxlib.expression
  2. | Alias of Ppxlib.core_type
  3. | Algebraic of elpi_constructor list * Ppxlib.expression option
Sourcetype elpi_type = {
  1. name : string;
  2. elpi_name : string;
  3. elpi_code : string option;
  4. elpi_doc : string;
  5. params : string list;
  6. type_decl : elpi_type_decl;
  7. pp : Ppxlib.expression option;
  8. index : Ppxlib.module_expr option;
}
Sourcemodule SSet : sig ... end
Sourcetype elpi_mutual_type = {
  1. types : elpi_type list;
  2. names : string list;
  3. ctx_names : SSet.t;
  4. context : (string * Ppxlib.module_expr * elpi_type) option;
}
Sourcetype type_extras = {
  1. ty_constants : Ppxlib.structure_item list;
  2. ty_embed : Ppxlib.value_binding;
  3. ty_readback : Ppxlib.value_binding;
  4. ty_ctx_class_type : Ppxlib.structure_item;
  5. ty_conversion : Ppxlib.value_binding list;
  6. ty_conversion_name : string;
  7. ty_elpi_declaration : elpi_declaration;
  8. ty_opaque : bool;
  9. ty_in_ctx : Ppxlib.structure_item list;
  10. ty_deep_copy : string option;
}
Sourceand elpi_declaration = {
  1. decl : Ppxlib.structure_item;
  2. decl_name : Ppxlib.expression;
}
Sourcetype context_extras = {
  1. ty_context_helpers : Ppxlib.structure_item list;
  2. ty_context_readback : Ppxlib.structure_item list;
}
Sourcetype mutual_type_extras = {
  1. ty_extras : type_extras list;
  2. ctx_extras : context_extras option;
}
Sourceval is_pred : ('a * 'b * 'c) option -> 'a -> bool
Sourceval ctx_for : string -> (string * 'a) list option -> 'a
Sourceval drop_skip : elpi_constructor list -> expose list
Sourceval keep_skip : elpi_constructor list -> (string * bool) list
Sourceval list_take : int -> 'a list -> 'a list
Sourceval embed_k : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> (string * Ppxlib__.Import.expression) list -> Ppxlib__.Import.expression list -> (string * Ppxlib_ast.Ast.expression) list -> string list -> arg_type list -> int -> Ppxlib_ast.Ast.expression
Sourceval embed_var : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib__.Import.expression list -> Ppxlib__.Import.expression -> Ppxlib_ast.Ast.expression
Sourceval error_constructor_not_supported : (module Ppxlib.Ast_builder.S) -> (string * bool) -> Ppxlib__.Import.case
Sourceval abstract_standard_branch_embed : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval embed_branch : (module Ppxlib.Ast_builder.S) -> bool -> elpi_constructor -> Ppxlib__.Import.case
Sourceval pexp_function_of_cases : (module Ppxlib.Ast_builder.S) -> Ppxlib__.Import.cases -> Ppxlib_ast.Ast.expression
Sourceval embed : (module Ppxlib.Ast_builder.S) -> bool -> elpi_constructor list -> Ppxlib_ast.Ast.expression
Sourceval readback_k : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> (Ppxlib__.Import.expression list -> Ppxlib_ast.Ast.expression) -> arg_type -> arg_type list -> Ppxlib_ast.Ast.expression
Sourceval readback_var : (module Ppxlib.Ast_builder.S) -> string -> (Ppxlib_ast.Ast.expression list -> Ppxlib_ast.Ast.expression) -> Ppxlib_ast.Ast.expression
Sourceval abstract_standard_branch_readback : (module Ppxlib.Ast_builder.S) -> Lexing.position -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval abstract_standard_branch_readback2 : (module Ppxlib.Ast_builder.S) -> Lexing.position -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval readback_branch : (module Ppxlib.Ast_builder.S) -> bool -> expose -> Ppxlib__.Import.case
Sourceval abstract_standard_default_readback : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval readback : (module Ppxlib.Ast_builder.S) -> string -> bool -> Ppxlib_ast.Ast.expression option -> elpi_constructor list -> Ppxlib_ast.Ast.expression
Sourceval ctx_entry_key : (module Ppxlib.Ast_builder.S) -> elpi_constructor list -> Ppxlib_ast.Ast.expression
Sourceval is_ctx_entry : (module Ppxlib.Ast_builder.S) -> elpi_constructor list -> Ppxlib_ast.Ast.expression
Sourceval compose_ctx_readback : (module Ppxlib.Ast_builder.S) -> string -> string list -> Ppxlib__.Import.structure_item list
Sourceval ctx_push : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib_ast.Ast.expression
Sourceval ctx_pop : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib_ast.Ast.expression
Sourceval fmap : ('a -> 'b option) -> 'a list -> 'b list
Sourceval conversion_of : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.core_type -> Ppxlib_ast.Ast.expression
Sourceval is_parameter : string -> bool
Sourceval find_embed_of : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib_ast.Ast.core_type -> Ppxlib_ast.Ast.expression
Sourceval find_readback_of : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib_ast.Ast.core_type -> Ppxlib_ast.Ast.expression
Sourceval find_ty_ast_of : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib.core_type -> Ppxlib_ast.Ast.expression
Sourceval find_mapper_of : (string * string) list -> (string * string) list -> Ppxlib_ast.Ast.core_type -> (string * string) -> string
Sourceval one_lident : Ppxlib.expression -> string option
Sourceval one_string : Ppxlib.expression -> string option
Sourceval one_or_two_strings : (module Ppxlib.Ast_builder.S) -> Ppxlib.expression_desc -> string * string option
Sourceval get_elpi_code : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib__.Import.constructor_declaration -> string * string option
Sourceval get_elpi_tcode : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib__.Import.type_declaration -> string * string option
Sourceval get_elpi_doc : string -> Ppxlib__.Import.constructor_declaration -> string
Sourceval get_elpi_tdoc : string -> Ppxlib__.Import.type_declaration -> string
Sourceval get_elpi_tdefkreadback : Ppxlib__.Import.type_declaration -> Ppxlib__.Import.expression option
Sourceval get_elpi_pp : Ppxlib__.Import.type_declaration -> Ppxlib__.Import.expression option
Sourceval get_elpi_tindex : Ppxlib__.Import.type_declaration -> Ppxlib__.Import.module_expr option
Sourceval get_elpi_tcdata : loc:Ppxlib.Location.t -> Ppxlib__.Import.type_declaration -> Ppxlib__.Import.expression
Sourceval has_elpi_tcdata : Ppxlib__.Import.type_declaration -> bool
Sourceval parse_lident_list : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> string list
Sourceval analyze_tuple_constructor : (module Ppxlib.Ast_builder.S) -> string -> string -> Ppxlib__.Import.constructor_declaration -> Ppxlib__.Import.core_type list -> (Ppxlib.expression list -> Ppxlib.expression) -> (Ppxlib.pattern list -> Ppxlib.pattern) -> string list -> elpi_constructor
Sourceval analyze_constructor : (module Ppxlib.Ast_builder.S) -> string -> string list -> Ppxlib.constructor_declaration -> elpi_constructor
Sourceval extract_tyvar : (Ppxlib.core_type * 'a) -> string
Sourceval analyze_params : (module Ppxlib.Ast_builder.S) -> (Ppxlib.core_type * 'a) list -> string list * Ppxlib.Ast_traverse.map
Sourceval mk_kind : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval consistency_check : loc:Ppxlib.Location.t -> elpi_type list -> (string * Ppxlib.module_expr * elpi_type) option
Sourceval pp_doc : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression option -> string -> bool -> elpi_constructor list -> Ppxlib_ast.Ast.expression
Sourceval poly_param_name : int -> string
Sourceval poly_param_conversion : (module Ppxlib.Ast_builder.S) -> int -> Ppxlib_ast.Ast.expression
Sourceval typeabbrev_for : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> 'a list -> Ppxlib_ast.Ast.expression
Sourceval typeabbrev_for_conv : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.core_type -> Ppxlib_ast.Ast.expression
Sourceval mk_pp_name : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib__.Import.expression option -> Ppxlib__.Import.expression
Sourceval pp_for_conversion : (module Ppxlib.Ast_builder.S) -> string -> bool -> string list -> Ppxlib__.Import.expression option -> Ppxlib_ast.Ast.expression
Sourceval quantify_ty_over_params : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib__.Import.core_type -> Ppxlib__.Import.core_type
Sourceval ctx_obj : (module Ppxlib.Ast_builder.S) -> string -> 'a -> 'b list -> Ppxlib_ast.Ast.core_type
Sourceval conversion_type : (module Ppxlib.Ast_builder.S) -> string -> string list -> bool -> 'a list -> Ppxlib__.Import.core_type
Sourceval readback_type : (module Ppxlib.Ast_builder.S) -> string -> string list -> bool -> 'a list -> Ppxlib__.Import.core_type
Sourceval embed_type : (module Ppxlib.Ast_builder.S) -> string -> string list -> bool -> 'a list -> Ppxlib__.Import.core_type
Sourceval lift_conversion : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval coversion_for_opaque : (module Ppxlib.Ast_builder.S) -> 'a -> string -> Ppxlib__.Import.value_binding
Sourceval abstract_expr_over_params : (module Ppxlib.Ast_builder.S) -> 'a list -> ('a -> string) -> Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression
Sourceval ctx_class_type_for_tyd : (module Ppxlib.Ast_builder.S) -> Ppxlib__.Import.label list -> elpi_type -> Ppxlib__.Import.structure_item
Sourceval conversion_for_tyd : (module Ppxlib.Ast_builder.S) -> 'a list -> elpi_type -> Ppxlib__.Import.value_binding list
Sourceval initial_state : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib_ast.Ast.expression
Sourceval conversion_context_for_tyd : (module Ppxlib.Ast_builder.S) -> string -> Ppxlib_ast.Ast.structure_item list
Sourceval embed_for_tyd : (module Ppxlib.Ast_builder.S) -> string list -> 'a list -> elpi_type -> Ppxlib__.Import.value_binding
Sourceval readback_for_tyd : (module Ppxlib.Ast_builder.S) -> string list -> 'a list -> elpi_type -> Ppxlib__.Import.value_binding
Sourceval in_ctx_for_tyd : (module Ppxlib.Ast_builder.S) -> Ppxlib__.Import.label list -> elpi_type -> Ppxlib__.Import.structure_item list
Sourceval constants_of_tyd : (module Ppxlib.Ast_builder.S) -> elpi_type -> Ppxlib__.Import.structure_item list
Sourceval elpi_declaration_of_tyd : (module Ppxlib.Ast_builder.S) -> elpi_type -> elpi_declaration
Sourceval analyze_build_ctx : Ppxlib.expression -> (string * int list) option
Sourceval deep_copy_for_tyd : (string * string) list -> elpi_type -> string option
Sourceval extras_of_task : (module Ppxlib.Ast_builder.S) -> elpi_mutual_type -> mutual_type_extras
Sourceval analyze_typedecl : (module Ppxlib.Ast_builder.S) -> string list -> Ppxlib.type_declaration -> elpi_type
Sourceval typedecl_extras : (module Ppxlib.Ast_builder.S) -> Ppxlib_ast.Ast.expression option -> Ppxlib.type_declaration list -> mutual_type_extras
Sourceval tydecls : loc:Ppxlib__.Location.t -> Ppxlib_ast.Ast.expression option -> Ppxlib_ast.Ast.expression option -> 'a -> Ppxlib.type_declaration list -> Ppxlib__.Import.structure_item list
Sourceval conversion_of_expansion : loc:Ppxlib__.Location.t -> path:'a -> Ppxlib_ast.Ast.core_type -> Ppxlib_ast.Ast.expression
Sourceval conversion_extension : Ppxlib.Extension.t
Sourceval expand_str : loc:Ppxlib__.Location.t -> path:'a -> ('b * Ppxlib.type_declaration list) -> Ppxlib.expression option -> Ppxlib.expression option -> Ppxlib__.Import.structure_item list
Sourceval expand_sig : loc:Ppxlib.Location.t -> path:'a -> ('b * 'c) -> Ppxlib.module_expr option -> 'd
Sourceval attributes : Ppxlib.Attribute.packed list
Sourceval str_type_decl_generator : (Ppxlib__.Import.structure, Ppxlib__.Import.rec_flag * Ppxlib.type_declaration list) Ppxlib.Deriving.Generator.t
Sourceval arguments : (Ppxlib__.Import.module_expr option -> Ppxlib__.Import.signature, Ppxlib__.Import.signature) Ppxlib.Deriving.Args.t
Sourceval sig_type_decl_generator : (Ppxlib__.Import.signature, Ppxlib__.Import.rec_flag * Ppxlib__.Import.type_declaration list) Ppxlib.Deriving.Generator.t
Sourceval my_deriver : Ppxlib.Deriving.t
Sourceval compose_ctx_expansion : loc:Ppxlib__.Location.t -> path:'a -> (string * string list) -> Ppxlib__.Import.structure_item
Sourceval compose_ctx_extension : Ppxlib.Extension.t