Build Ast helpers with the location argument factorized.
module Located : Ppxlib__.Ast_builder_intf.Located with type a with_loc := a Ppxlib__.Ast_builder_intf.without_location
include module type of sig ... end
val loc : Ppxlib.Location.t
val case : lhs:Ppxlib__.Import.pattern ‑> guard:Ppxlib__.Import.expression option ‑> rhs:Ppxlib__.Import.expression ‑> Ppxlib__.Import.case
val pcl_constr : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.core_type list ‑> Ppxlib__.Import.class_expr
val pcl_structure : Ppxlib__.Import.class_structure ‑> Ppxlib__.Import.class_expr
val pcl_fun : Ppxlib__.Import.arg_label ‑> Ppxlib__.Import.expression option ‑> Ppxlib__.Import.pattern ‑> Ppxlib__.Import.class_expr ‑> Ppxlib__.Import.class_expr
val pcl_apply : Ppxlib__.Import.class_expr ‑> (Ppxlib__.Import.arg_label * Ppxlib__.Import.expression) list ‑> Ppxlib__.Import.class_expr
val pcl_let : Ppxlib__.Import.rec_flag ‑> Ppxlib__.Import.value_binding list ‑> Ppxlib__.Import.class_expr ‑> Ppxlib__.Import.class_expr
val pcl_constraint : Ppxlib__.Import.class_expr ‑> Ppxlib__.Import.class_type ‑> Ppxlib__.Import.class_expr
val pcl_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.class_expr
val pcf_inherit : Ppxlib__.Import.override_flag ‑> Ppxlib__.Import.class_expr ‑> string Ppxlib__.Import.loc option ‑> Ppxlib__.Import.class_field
val pcf_val : (string Ppxlib__.Import.loc * Ppxlib__.Import.mutable_flag * Ppxlib__.Import.class_field_kind) ‑> Ppxlib__.Import.class_field
val pcf_method : (string Ppxlib__.Import.loc * Ppxlib__.Import.private_flag * Ppxlib__.Import.class_field_kind) ‑> Ppxlib__.Import.class_field
val pcf_constraint : (Ppxlib__.Import.core_type * Ppxlib__.Import.core_type) ‑> Ppxlib__.Import.class_field
val pcf_initializer : Ppxlib__.Import.expression ‑> Ppxlib__.Import.class_field
val pcf_attribute : Ppxlib__.Import.attribute ‑> Ppxlib__.Import.class_field
val pcf_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.class_field
val class_infos : virt:Ppxlib__.Import.virtual_flag ‑> params:(Ppxlib__.Import.core_type * Ppxlib__.Import.variance) list ‑> name:string Ppxlib__.Import.loc ‑> expr:'a ‑> 'a Ppxlib__.Import.class_infos
val class_signature : self:Ppxlib__.Import.core_type ‑> fields:Ppxlib__.Import.class_type_field list ‑> Ppxlib__.Import.class_signature
val class_structure : self:Ppxlib__.Import.pattern ‑> fields:Ppxlib__.Import.class_field list ‑> Ppxlib__.Import.class_structure
val pcty_constr : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.core_type list ‑> Ppxlib__.Import.class_type
val pcty_signature : Ppxlib__.Import.class_signature ‑> Ppxlib__.Import.class_type
val pcty_arrow : Ppxlib__.Import.arg_label ‑> Ppxlib__.Import.core_type ‑> Ppxlib__.Import.class_type ‑> Ppxlib__.Import.class_type
val pcty_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.class_type
val pctf_inherit : Ppxlib__.Import.class_type ‑> Ppxlib__.Import.class_type_field
val pctf_val : (string Ppxlib__.Import.loc * Ppxlib__.Import.mutable_flag * Ppxlib__.Import.virtual_flag * Ppxlib__.Import.core_type) ‑> Ppxlib__.Import.class_type_field
val pctf_method : (string Ppxlib__.Import.loc * Ppxlib__.Import.private_flag * Ppxlib__.Import.virtual_flag * Ppxlib__.Import.core_type) ‑> Ppxlib__.Import.class_type_field
val pctf_constraint : (Ppxlib__.Import.core_type * Ppxlib__.Import.core_type) ‑> Ppxlib__.Import.class_type_field
val pctf_attribute : Ppxlib__.Import.attribute ‑> Ppxlib__.Import.class_type_field
val pctf_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.class_type_field
val constructor_declaration : name:string Ppxlib__.Import.loc ‑> args:Ppxlib__.Import.constructor_arguments ‑> res:Ppxlib__.Import.core_type option ‑> Ppxlib__.Import.constructor_declaration
val ptyp_any : Ppxlib__.Import.core_type
val ptyp_var : string ‑> Ppxlib__.Import.core_type
val ptyp_arrow : Ppxlib__.Import.arg_label ‑> Ppxlib__.Import.core_type ‑> Ppxlib__.Import.core_type ‑> Ppxlib__.Import.core_type
val ptyp_tuple : Ppxlib__.Import.core_type list ‑> Ppxlib__.Import.core_type
val ptyp_constr : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.core_type list ‑> Ppxlib__.Import.core_type
val ptyp_object : (string Ppxlib__.Import.loc * Ppxlib__.Import.attributes * Ppxlib__.Import.core_type) list ‑> Ppxlib__.Import.closed_flag ‑> Ppxlib__.Import.core_type
val ptyp_class : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.core_type list ‑> Ppxlib__.Import.core_type
val ptyp_alias : Ppxlib__.Import.core_type ‑> string ‑> Ppxlib__.Import.core_type
val ptyp_variant : Ppxlib__.Import.row_field list ‑> Ppxlib__.Import.closed_flag ‑> Ppxlib__.Import.label list option ‑> Ppxlib__.Import.core_type
val ptyp_poly : string Ppxlib__.Import.loc list ‑> Ppxlib__.Import.core_type ‑> Ppxlib__.Import.core_type
val ptyp_package : Ppxlib__.Import.package_type ‑> Ppxlib__.Import.core_type
val ptyp_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.core_type
val pexp_ident : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.expression
val pexp_constant : Ppxlib__.Import.constant ‑> Ppxlib__.Import.expression
val pexp_let : Ppxlib__.Import.rec_flag ‑> Ppxlib__.Import.value_binding list ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_function : Ppxlib__.Import.case list ‑> Ppxlib__.Import.expression
val pexp_fun : Ppxlib__.Import.arg_label ‑> Ppxlib__.Import.expression option ‑> Ppxlib__.Import.pattern ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_apply : Ppxlib__.Import.expression ‑> (Ppxlib__.Import.arg_label * Ppxlib__.Import.expression) list ‑> Ppxlib__.Import.expression
val pexp_match : Ppxlib__.Import.expression ‑> Ppxlib__.Import.case list ‑> Ppxlib__.Import.expression
val pexp_try : Ppxlib__.Import.expression ‑> Ppxlib__.Import.case list ‑> Ppxlib__.Import.expression
val pexp_tuple : Ppxlib__.Import.expression list ‑> Ppxlib__.Import.expression
val pexp_construct : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.expression option ‑> Ppxlib__.Import.expression
val pexp_variant : Ppxlib__.Import.label ‑> Ppxlib__.Import.expression option ‑> Ppxlib__.Import.expression
val pexp_record : (Ppxlib__.Import.longident_loc * Ppxlib__.Import.expression) list ‑> Ppxlib__.Import.expression option ‑> Ppxlib__.Import.expression
val pexp_field : Ppxlib__.Import.expression ‑> Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.expression
val pexp_setfield : Ppxlib__.Import.expression ‑> Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_array : Ppxlib__.Import.expression list ‑> Ppxlib__.Import.expression
val pexp_ifthenelse : Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression option ‑> Ppxlib__.Import.expression
val pexp_sequence : Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_while : Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_constraint : Ppxlib__.Import.expression ‑> Ppxlib__.Import.core_type ‑> Ppxlib__.Import.expression
val pexp_coerce : Ppxlib__.Import.expression ‑> Ppxlib__.Import.core_type option ‑> Ppxlib__.Import.core_type ‑> Ppxlib__.Import.expression
val pexp_send : Ppxlib__.Import.expression ‑> string Ppxlib__.Import.loc ‑> Ppxlib__.Import.expression
val pexp_new : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.expression
val pexp_setinstvar : string Ppxlib__.Import.loc ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_override : (string Ppxlib__.Import.loc * Ppxlib__.Import.expression) list ‑> Ppxlib__.Import.expression
val pexp_letmodule : string Ppxlib__.Import.loc ‑> Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_letexception : Ppxlib__.Import.extension_constructor ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_assert : Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_lazy : Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_poly : Ppxlib__.Import.expression ‑> Ppxlib__.Import.core_type option ‑> Ppxlib__.Import.expression
val pexp_object : Ppxlib__.Import.class_structure ‑> Ppxlib__.Import.expression
val pexp_newtype : string Ppxlib__.Import.loc ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_pack : Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.expression
val pexp_open : Ppxlib__.Import.override_flag ‑> Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val pexp_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.expression
val pexp_unreachable : Ppxlib__.Import.expression
val extension_constructor : name:string Ppxlib__.Import.loc ‑> kind:Ppxlib__.Import.extension_constructor_kind ‑> Ppxlib__.Import.extension_constructor
val include_infos : 'a ‑> 'a Ppxlib__.Import.include_infos
val label_declaration : name:string Ppxlib__.Import.loc ‑> mutable_:Ppxlib__.Import.mutable_flag ‑> type_:Ppxlib__.Import.core_type ‑> Ppxlib__.Import.label_declaration
val location : start:Ppxlib__.Import.position ‑> end_:Ppxlib__.Import.position ‑> ghost:bool ‑> Ppxlib__.Import.location
val module_binding : name:string Ppxlib__.Import.loc ‑> expr:Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.module_binding
val module_declaration : name:string Ppxlib__.Import.loc ‑> type_:Ppxlib__.Import.module_type ‑> Ppxlib__.Import.module_declaration
val pmod_ident : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.module_expr
val pmod_structure : Ppxlib__.Import.structure ‑> Ppxlib__.Import.module_expr
val pmod_functor : string Ppxlib__.Import.loc ‑> Ppxlib__.Import.module_type option ‑> Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.module_expr
val pmod_apply : Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.module_expr
val pmod_constraint : Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.module_type ‑> Ppxlib__.Import.module_expr
val pmod_unpack : Ppxlib__.Import.expression ‑> Ppxlib__.Import.module_expr
val pmod_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.module_expr
val pmty_ident : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.module_type
val pmty_signature : Ppxlib__.Import.signature ‑> Ppxlib__.Import.module_type
val pmty_functor : string Ppxlib__.Import.loc ‑> Ppxlib__.Import.module_type option ‑> Ppxlib__.Import.module_type ‑> Ppxlib__.Import.module_type
val pmty_with : Ppxlib__.Import.module_type ‑> Ppxlib__.Import.with_constraint list ‑> Ppxlib__.Import.module_type
val pmty_typeof : Ppxlib__.Import.module_expr ‑> Ppxlib__.Import.module_type
val pmty_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.module_type
val pmty_alias : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.module_type
val module_type_declaration : name:string Ppxlib__.Import.loc ‑> type_:Ppxlib__.Import.module_type option ‑> Ppxlib__.Import.module_type_declaration
val open_description : lid:Ppxlib__.Import.longident_loc ‑> override:Ppxlib__.Import.override_flag ‑> Ppxlib__.Import.open_description
val ppat_any : Ppxlib__.Import.pattern
val ppat_var : string Ppxlib__.Import.loc ‑> Ppxlib__.Import.pattern
val ppat_alias : Ppxlib__.Import.pattern ‑> string Ppxlib__.Import.loc ‑> Ppxlib__.Import.pattern
val ppat_constant : Ppxlib__.Import.constant ‑> Ppxlib__.Import.pattern
val ppat_interval : Ppxlib__.Import.constant ‑> Ppxlib__.Import.constant ‑> Ppxlib__.Import.pattern
val ppat_tuple : Ppxlib__.Import.pattern list ‑> Ppxlib__.Import.pattern
val ppat_construct : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.pattern option ‑> Ppxlib__.Import.pattern
val ppat_variant : Ppxlib__.Import.label ‑> Ppxlib__.Import.pattern option ‑> Ppxlib__.Import.pattern
val ppat_record : (Ppxlib__.Import.longident_loc * Ppxlib__.Import.pattern) list ‑> Ppxlib__.Import.closed_flag ‑> Ppxlib__.Import.pattern
val ppat_array : Ppxlib__.Import.pattern list ‑> Ppxlib__.Import.pattern
val ppat_or : Ppxlib__.Import.pattern ‑> Ppxlib__.Import.pattern ‑> Ppxlib__.Import.pattern
val ppat_constraint : Ppxlib__.Import.pattern ‑> Ppxlib__.Import.core_type ‑> Ppxlib__.Import.pattern
val ppat_type : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.pattern
val ppat_lazy : Ppxlib__.Import.pattern ‑> Ppxlib__.Import.pattern
val ppat_unpack : string Ppxlib__.Import.loc ‑> Ppxlib__.Import.pattern
val ppat_exception : Ppxlib__.Import.pattern ‑> Ppxlib__.Import.pattern
val ppat_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.pattern
val ppat_open : Ppxlib__.Import.longident_loc ‑> Ppxlib__.Import.pattern ‑> Ppxlib__.Import.pattern
val position : fname:string ‑> lnum:int ‑> bol:int ‑> cnum:int ‑> Ppxlib__.Import.position
val psig_value : Ppxlib__.Import.value_description ‑> Ppxlib__.Import.signature_item
val psig_type : Ppxlib__.Import.rec_flag ‑> Ppxlib__.Import.type_declaration list ‑> Ppxlib__.Import.signature_item
val psig_typext : Ppxlib__.Import.type_extension ‑> Ppxlib__.Import.signature_item
val psig_exception : Ppxlib__.Import.extension_constructor ‑> Ppxlib__.Import.signature_item
val psig_module : Ppxlib__.Import.module_declaration ‑> Ppxlib__.Import.signature_item
val psig_recmodule : Ppxlib__.Import.module_declaration list ‑> Ppxlib__.Import.signature_item
val psig_modtype : Ppxlib__.Import.module_type_declaration ‑> Ppxlib__.Import.signature_item
val psig_open : Ppxlib__.Import.open_description ‑> Ppxlib__.Import.signature_item
val psig_include : Ppxlib__.Import.include_description ‑> Ppxlib__.Import.signature_item
val psig_class : Ppxlib__.Import.class_description list ‑> Ppxlib__.Import.signature_item
val psig_class_type : Ppxlib__.Import.class_type_declaration list ‑> Ppxlib__.Import.signature_item
val psig_attribute : Ppxlib__.Import.attribute ‑> Ppxlib__.Import.signature_item
val psig_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.attributes ‑> Ppxlib__.Import.signature_item
val pstr_eval : Ppxlib__.Import.expression ‑> Ppxlib__.Import.attributes ‑> Ppxlib__.Import.structure_item
val pstr_value : Ppxlib__.Import.rec_flag ‑> Ppxlib__.Import.value_binding list ‑> Ppxlib__.Import.structure_item
val pstr_primitive : Ppxlib__.Import.value_description ‑> Ppxlib__.Import.structure_item
val pstr_type : Ppxlib__.Import.rec_flag ‑> Ppxlib__.Import.type_declaration list ‑> Ppxlib__.Import.structure_item
val pstr_typext : Ppxlib__.Import.type_extension ‑> Ppxlib__.Import.structure_item
val pstr_exception : Ppxlib__.Import.extension_constructor ‑> Ppxlib__.Import.structure_item
val pstr_module : Ppxlib__.Import.module_binding ‑> Ppxlib__.Import.structure_item
val pstr_recmodule : Ppxlib__.Import.module_binding list ‑> Ppxlib__.Import.structure_item
val pstr_modtype : Ppxlib__.Import.module_type_declaration ‑> Ppxlib__.Import.structure_item
val pstr_open : Ppxlib__.Import.open_description ‑> Ppxlib__.Import.structure_item
val pstr_class : Ppxlib__.Import.class_declaration list ‑> Ppxlib__.Import.structure_item
val pstr_class_type : Ppxlib__.Import.class_type_declaration list ‑> Ppxlib__.Import.structure_item
val pstr_include : Ppxlib__.Import.include_declaration ‑> Ppxlib__.Import.structure_item
val pstr_attribute : Ppxlib__.Import.attribute ‑> Ppxlib__.Import.structure_item
val pstr_extension : Ppxlib__.Import.extension ‑> Ppxlib__.Import.attributes ‑> Ppxlib__.Import.structure_item
val type_declaration : name:string Ppxlib__.Import.loc ‑> params:(Ppxlib__.Import.core_type * Ppxlib__.Import.variance) list ‑> cstrs:(Ppxlib__.Import.core_type * Ppxlib__.Import.core_type * Ppxlib__.Import.location) list ‑> kind:Ppxlib__.Import.type_kind ‑> private_:Ppxlib__.Import.private_flag ‑> manifest:Ppxlib__.Import.core_type option ‑> Ppxlib__.Import.type_declaration
val type_extension : path:Ppxlib__.Import.longident_loc ‑> params:(Ppxlib__.Import.core_type * Ppxlib__.Import.variance) list ‑> constructors:Ppxlib__.Import.extension_constructor list ‑> private_:Ppxlib__.Import.private_flag ‑> Ppxlib__.Import.type_extension
val value_binding : pat:Ppxlib__.Import.pattern ‑> expr:Ppxlib__.Import.expression ‑> Ppxlib__.Import.value_binding
val value_description : name:string Ppxlib__.Import.loc ‑> type_:Ppxlib__.Import.core_type ‑> prim:string list ‑> Ppxlib__.Import.value_description
include Ppxlib__.Ast_builder_intf.Additional_helpers with type a with_loc := a Ppxlib__.Ast_builder_intf.without_location
val eint : (Ppxlib__.Import.int ‑> Ppxlib__.Import.expression) with_loc
val echar : (Ppxlib__.Import.char ‑> Ppxlib__.Import.expression) with_loc
val estring : (Ppxlib__.Import.string ‑> Ppxlib__.Import.expression) with_loc
val efloat : (Ppxlib__.Import.string ‑> Ppxlib__.Import.expression) with_loc
val eint32 : (Ppxlib__.Import.int32 ‑> Ppxlib__.Import.expression) with_loc
val eint64 : (Ppxlib__.Import.int64 ‑> Ppxlib__.Import.expression) with_loc
val enativeint : (Ppxlib__.Import.nativeint ‑> Ppxlib__.Import.expression) with_loc
val ebool : (Ppxlib__.Import.bool ‑> Ppxlib__.Import.expression) with_loc
val pint : (Ppxlib__.Import.int ‑> Ppxlib__.Import.pattern) with_loc
val pchar : (Ppxlib__.Import.char ‑> Ppxlib__.Import.pattern) with_loc
val pstring : (Ppxlib__.Import.string ‑> Ppxlib__.Import.pattern) with_loc
val pfloat : (Ppxlib__.Import.string ‑> Ppxlib__.Import.pattern) with_loc
val pint32 : (Ppxlib__.Import.int32 ‑> Ppxlib__.Import.pattern) with_loc
val pint64 : (Ppxlib__.Import.int64 ‑> Ppxlib__.Import.pattern) with_loc
val pnativeint : (Ppxlib__.Import.nativeint ‑> Ppxlib__.Import.pattern) with_loc
val pbool : (Ppxlib__.Import.bool ‑> Ppxlib__.Import.pattern) with_loc
val eunit : Ppxlib__.Import.expression with_loc
val punit : Ppxlib__.Import.pattern with_loc
val evar : (Ppxlib__.Import.string ‑> Ppxlib__.Import.expression) with_loc
evar id
produces a Pexp_ident _
expression, it parses its input so you can pass
any dot-separated identifier, for instance: evar ~loc "Foo.bar"
.
val pvar : (Ppxlib__.Import.string ‑> Ppxlib__.Import.pattern) with_loc
val eapply : (Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression Ppxlib__.Import.list ‑> Ppxlib__.Import.expression) with_loc
Same as pexp_apply but without labels
val eabstract : (Ppxlib__.Import.pattern Ppxlib__.Import.list ‑> Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression) with_loc
val esequence : (Ppxlib__.Import.expression Ppxlib__.Import.list ‑> Ppxlib__.Import.expression) with_loc
val ppat_tuple_opt : (Ppxlib__.Import.pattern Ppxlib__.Import.list ‑> Ppxlib__.Import.pattern Ppxlib__.Import.option) with_loc
val pexp_tuple_opt : (Ppxlib__.Import.expression Ppxlib__.Import.list ‑> Ppxlib__.Import.expression Ppxlib__.Import.option) with_loc
val elist : (Ppxlib__.Import.expression Ppxlib__.Import.list ‑> Ppxlib__.Import.expression) with_loc
val plist : (Ppxlib__.Import.pattern Ppxlib__.Import.list ‑> Ppxlib__.Import.pattern) with_loc
val pstr_value_list : loc:Ppxlib.Location.t ‑> Ppxlib__.Import.Asttypes.rec_flag ‑> Ppxlib__.Import.value_binding Ppxlib__.Import.list ‑> Ppxlib__.Import.structure_item Ppxlib__.Import.list
pstr_value_list ~loc rf vbs
= pstr_value ~loc rf vbs
if vbs <> []
, []
otherwise.
val nonrec_type_declaration : (name:Ppxlib__.Import.string Ppxlib.Loc.t ‑> params:(Ppxlib__.Import.core_type * Ppxlib__.Import.Asttypes.variance) Ppxlib__.Import.list ‑> cstrs:(Ppxlib__.Import.core_type * Ppxlib__.Import.core_type * Ppxlib.Location.t) Ppxlib__.Import.list ‑> kind:Ppxlib__.Import.type_kind ‑> private_:Ppxlib__.Import.Asttypes.private_flag ‑> manifest:Ppxlib__.Import.core_type Ppxlib__.Import.option ‑> Ppxlib__.Import.type_declaration) with_loc
val unapplied_type_constr_conv : (Ppxlib.Longident.t Ppxlib.Loc.t ‑> f:(Ppxlib__.Import.string ‑> Ppxlib__.Import.string) ‑> Ppxlib__.Import.expression) with_loc
unapplied_type_constr_conv
is the standard way to map identifiers to conversion
fonctions, for preprocessor that creates values that follow the structure of types.
More precisely, path_conv path (sprintf "sexp_of_%s")
is:
type_constr_conv
also applies it to a list of expression, which both prevents
the compiler from allocating useless closures, and almost always what is needed,
since type constructors are always applied.val type_constr_conv : (Ppxlib.Longident.t Ppxlib.Loc.t ‑> f:(Ppxlib__.Import.string ‑> Ppxlib__.Import.string) ‑> Ppxlib__.Import.expression Ppxlib__.Import.list ‑> Ppxlib__.Import.expression) with_loc
val eta_reduce : Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression Ppxlib__.Import.option
Tries to simplify fun v1 v2 .. -> f v1 v2 ..
into f
. Only works when f
is a
path, not an arbitrary expression as that would change the meaning of
the code.
This can be used either for cleaning up the generated code, or to reduce allocation
if f
is a local variable (the compiler won't optimize the allocation of the
closure).
Eta-reduction can change the types/behavior in some corner cases that are unlikely to show up in generated code:
f
has optional arguments, eta-expanding f
can drop themf
does side effects before receiving all its arguments, and if
the eta-expansion is partially applied, eta-reducing could change behavior.eta_reduce_if_possible_and_nonrec
is meant for the case where the resulting
expression is going to be bound in a potentially recursive let-binding, where
we have to keep the eta-expansion when rec_flag
is Recursive
to avoid
a compile error.
val eta_reduce_if_possible : Ppxlib__.Import.expression ‑> Ppxlib__.Import.expression
val eta_reduce_if_possible_and_nonrec : Ppxlib__.Import.expression ‑> rec_flag:Ppxlib__.Import.rec_flag ‑> Ppxlib__.Import.expression