package ppx_core

  1. Overview
  2. Docs

Helpers taking a ~loc argument. This module is meant to be opened or aliased.

Helpers taking a ~loc argument. This module is meant to be opened or aliased.

Helpers taking a ~loc argument. This module is meant to be opened or aliased.

module Located : sig ... end
val pcl_constr : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_expr
val pcl_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_expr
val pcf_attribute : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_field
val pcf_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_field
val class_infos : loc:Ppx_ast__.Import.Location.t -> virt:Migrate_parsetree.OCaml_403.Ast.Asttypes.virtual_flag -> params: (Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type * Migrate_parsetree.OCaml_403.Ast.Asttypes.variance) list -> name:string Ppx_ast__.Import.Location.loc -> expr:'a -> 'a Migrate_parsetree.OCaml_403.Ast.Parsetree.class_infos
val pcty_constr : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_type
val pcty_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_type
val pctf_attribute : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_type_field
val pctf_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.class_type_field
val constructor_declaration : loc:Ppx_ast__.Import.Location.t -> name:string Ppx_ast__.Import.Location.loc -> args:Migrate_parsetree.OCaml_403.Ast.Parsetree.constructor_arguments -> res:Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.constructor_declaration
val ptyp_any : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type
val ptyp_var : loc:Ppx_ast__.Import.Location.t -> string -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type
val ptyp_constr : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type
val ptyp_class : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type
val ptyp_poly : loc:Ppx_ast__.Import.Location.t -> string list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type
val ptyp_package : loc:Ppx_ast__.Import.Location.t -> (Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc * (Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type) list) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type
val ptyp_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type
val pexp_ident : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_construct : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_variant : loc:Ppx_ast__.Import.Location.t -> string -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_record : loc:Ppx_ast__.Import.Location.t -> (Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.expression) list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_field : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_setfield : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_new : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_setinstvar : loc:Ppx_ast__.Import.Location.t -> string Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_override : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.expression) list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_open : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Asttypes.override_flag -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val pexp_unreachable : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression
val extension_constructor : loc:Ppx_ast__.Import.Location.t -> name:string Ppx_ast__.Import.Location.loc -> kind:Migrate_parsetree.OCaml_403.Ast.Parsetree.extension_constructor_kind -> Migrate_parsetree.OCaml_403.Ast.Parsetree.extension_constructor
val include_infos : loc:Ppx_ast__.Import.Location.t -> 'a -> 'a Migrate_parsetree.OCaml_403.Ast.Parsetree.include_infos
val label_declaration : loc:Ppx_ast__.Import.Location.t -> name:string Ppx_ast__.Import.Location.loc -> mutable_:Migrate_parsetree.OCaml_403.Ast.Asttypes.mutable_flag -> type_:Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type -> Migrate_parsetree.OCaml_403.Ast.Parsetree.label_declaration
val location : start:Lexing.position -> end_:Lexing.position -> ghost:bool -> Ppx_ast__.Import.Location.t
val module_binding : loc:Ppx_ast__.Import.Location.t -> name:string Ppx_ast__.Import.Location.loc -> expr:Migrate_parsetree.OCaml_403.Ast.Parsetree.module_expr -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_binding
val module_declaration : loc:Ppx_ast__.Import.Location.t -> name:string Ppx_ast__.Import.Location.loc -> type_:Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_declaration
val pmod_ident : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_expr
val pmod_functor : loc:Ppx_ast__.Import.Location.t -> string Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_expr -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_expr
val pmod_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_expr
val pmty_ident : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type
val pmty_functor : loc:Ppx_ast__.Import.Location.t -> string Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type
val pmty_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type
val pmty_alias : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type
val module_type_declaration : loc:Ppx_ast__.Import.Location.t -> name:string Ppx_ast__.Import.Location.loc -> type_:Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.module_type_declaration
val open_description : loc:Ppx_ast__.Import.Location.t -> lid:Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> override:Migrate_parsetree.OCaml_403.Ast.Asttypes.override_flag -> Migrate_parsetree.OCaml_403.Ast.Parsetree.open_description
val ppat_any : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_var : loc:Ppx_ast__.Import.Location.t -> string Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_alias : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern -> string Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_construct : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_variant : loc:Ppx_ast__.Import.Location.t -> string -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern option -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_record : loc:Ppx_ast__.Import.Location.t -> (Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern) list -> Migrate_parsetree.OCaml_403.Ast.Asttypes.closed_flag -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_type : loc:Ppx_ast__.Import.Location.t -> Ppx_ast__.Import.Longident.t Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_unpack : loc:Ppx_ast__.Import.Location.t -> string Ppx_ast__.Import.Location.loc -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val ppat_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.pattern
val position : fname:string -> lnum:int -> bol:int -> cnum:int -> Lexing.position
val psig_attribute : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.signature_item
val psig_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.signature_item
val pstr_eval : loc:Ppx_ast__.Import.Location.t -> Migrate_parsetree.OCaml_403.Ast.Parsetree.expression -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.structure_item
val pstr_attribute : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> Migrate_parsetree.OCaml_403.Ast.Parsetree.structure_item
val pstr_extension : loc:Ppx_ast__.Import.Location.t -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) -> (string Ppx_ast__.Import.Location.loc * Migrate_parsetree.OCaml_403.Ast.Parsetree.payload) list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.structure_item
val value_description : loc:Ppx_ast__.Import.Location.t -> name:string Ppx_ast__.Import.Location.loc -> type_:Migrate_parsetree.OCaml_403.Ast.Parsetree.core_type -> prim:string list -> Migrate_parsetree.OCaml_403.Ast.Parsetree.value_description

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".

pstr_value_list ~loc rf vbs = pstr_value ~loc rf vbs if vbs <> [], [] otherwise.

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:

  • sexp_of_t if path is "t"
  • A.B.sexp_of_foo if path is "A.B.foo"
  • A.B.sexp_of_f__foo (module A1) (module A2) if path is "A.B.F(A1)(A2).foo" 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.
OCaml

Innovation. Community. Security.