Module Ppx_core.Ast_builder.Default

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

module Located : Ppx_core__.Ast_builder_intf.Located with type with_loc := a Ppx_core__.Ast_builder_intf.with_location
include module type of Ppx_core__.Ast_builder_generated.M
val ptyp_var : loc:Ppx_core__.Import.location ‑> string ‑> Ppx_core__.Import.core_type
val include_infos : loc:Ppx_core__.Import.location ‑> 'a ‑> 'a Ppx_core__.Import.include_infos
val location : start:Ppx_core__.Import.position ‑> end_:Ppx_core__.Import.position ‑> ghost:bool ‑> Ppx_core__.Import.location
val position : fname:string ‑> lnum:int ‑> bol:int ‑> cnum:int ‑> Ppx_core__.Import.position
val value_description : loc:Ppx_core__.Import.location ‑> name:string Ppx_core__.Import.loc ‑> type_:Ppx_core__.Import.core_type ‑> prim:string list ‑> Ppx_core__.Import.value_description
include Ppx_core__.Ast_builder_intf.Additional_helpers with type with_loc := a Ppx_core__.Ast_builder_intf.with_location
type 'a 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".

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.