package ppxlib

  1. Overview
  2. Docs

Build Ast helpers with the location argument factorized.

Parameters

module Loc : Loc

Signature

module Located : sig ... end
include sig ... end
val loc : Location.t
val attribute : name:string Location.loc -> payload:Ppxlib_ast__.Import.Parsetree.payload -> Ppxlib_ast__.Import.Parsetree.attribute
val binding_op : op:string Location.loc -> pat:Ppxlib_ast__.Import.Parsetree.pattern -> exp:Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.binding_op
val case : lhs:Ppxlib_ast__.Import.Parsetree.pattern -> guard:Ppxlib_ast__.Import.Parsetree.expression option -> rhs:Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.case
val pcl_constr : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_structure : Ppxlib_ast__.Import.Parsetree.class_structure -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_fun : Ppxlib_ast__.Import.Asttypes.arg_label -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.class_expr -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_apply : Ppxlib_ast__.Import.Parsetree.class_expr -> (Ppxlib_ast__.Import.Asttypes.arg_label * Ppxlib_ast__.Import.Parsetree.expression) list -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_let : Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.value_binding list -> Ppxlib_ast__.Import.Parsetree.class_expr -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_constraint : Ppxlib_ast__.Import.Parsetree.class_expr -> Ppxlib_ast__.Import.Parsetree.class_type -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_open : Ppxlib_ast__.Import.Longident.t Location.loc Ppxlib_ast__.Import.Parsetree.open_infos -> Ppxlib_ast__.Import.Parsetree.class_expr -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcf_inherit : Ppxlib_ast__.Import.Asttypes.override_flag -> Ppxlib_ast__.Import.Parsetree.class_expr -> string Location.loc option -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_val : (string Location.loc * Ppxlib_ast__.Import.Asttypes.mutable_flag * Ppxlib_ast__.Import.Parsetree.class_field_kind) -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_method : (string Location.loc * Ppxlib_ast__.Import.Asttypes.private_flag * Ppxlib_ast__.Import.Parsetree.class_field_kind) -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_constraint : (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Parsetree.core_type) -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_initializer : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_attribute : Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_field
val class_infos : virt:Ppxlib_ast__.Import.Asttypes.virtual_flag -> params: (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Asttypes.variance) list -> name:string Location.loc -> expr:'a -> 'a Ppxlib_ast__.Import.Parsetree.class_infos
val class_signature : self:Ppxlib_ast__.Import.Parsetree.core_type -> fields:Ppxlib_ast__.Import.Parsetree.class_type_field list -> Ppxlib_ast__.Import.Parsetree.class_signature
val class_structure : self:Ppxlib_ast__.Import.Parsetree.pattern -> fields:Ppxlib_ast__.Import.Parsetree.class_field list -> Ppxlib_ast__.Import.Parsetree.class_structure
val pcty_constr : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.class_type
val pcty_signature : Ppxlib_ast__.Import.Parsetree.class_signature -> Ppxlib_ast__.Import.Parsetree.class_type
val pcty_arrow : Ppxlib_ast__.Import.Asttypes.arg_label -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.class_type -> Ppxlib_ast__.Import.Parsetree.class_type
val pcty_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_type
val pcty_open : Ppxlib_ast__.Import.Longident.t Location.loc Ppxlib_ast__.Import.Parsetree.open_infos -> Ppxlib_ast__.Import.Parsetree.class_type -> Ppxlib_ast__.Import.Parsetree.class_type
val pctf_inherit : Ppxlib_ast__.Import.Parsetree.class_type -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_val : (string Location.loc * Ppxlib_ast__.Import.Asttypes.mutable_flag * Ppxlib_ast__.Import.Asttypes.virtual_flag * Ppxlib_ast__.Import.Parsetree.core_type) -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_method : (string Location.loc * Ppxlib_ast__.Import.Asttypes.private_flag * Ppxlib_ast__.Import.Asttypes.virtual_flag * Ppxlib_ast__.Import.Parsetree.core_type) -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_constraint : (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Parsetree.core_type) -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_attribute : Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_type_field
val constructor_declaration : name:string Location.loc -> args:Ppxlib_ast__.Import.Parsetree.constructor_arguments -> res:Ppxlib_ast__.Import.Parsetree.core_type option -> Ppxlib_ast__.Import.Parsetree.constructor_declaration
val ptyp_any : Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_var : string -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_arrow : Ppxlib_ast__.Import.Asttypes.arg_label -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_tuple : Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_constr : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_object : Ppxlib_ast__.Import.Parsetree.object_field list -> Ppxlib_ast__.Import.Asttypes.closed_flag -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_class : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_alias : Ppxlib_ast__.Import.Parsetree.core_type -> string -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_variant : Ppxlib_ast__.Import.Parsetree.row_field list -> Ppxlib_ast__.Import.Asttypes.closed_flag -> string list option -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_poly : string Location.loc list -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_package : (Ppxlib_ast__.Import.Longident.t Location.loc * (Ppxlib_ast__.Import.Longident.t Location.loc * Ppxlib_ast__.Import.Parsetree.core_type) list) -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.core_type
val pdir_string : string -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pdir_int : string -> char option -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pdir_ident : Ppxlib_ast__.Import.Longident.t -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pdir_bool : bool -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pexp_ident : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_constant : Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_let : Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.value_binding list -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_function : Ppxlib_ast__.Import.Parsetree.case list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_fun : Ppxlib_ast__.Import.Asttypes.arg_label -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_apply : Ppxlib_ast__.Import.Parsetree.expression -> (Ppxlib_ast__.Import.Asttypes.arg_label * Ppxlib_ast__.Import.Parsetree.expression) list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_match : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.case list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_try : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.case list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_tuple : Ppxlib_ast__.Import.Parsetree.expression list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_construct : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_variant : string -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_record : (Ppxlib_ast__.Import.Longident.t Location.loc * Ppxlib_ast__.Import.Parsetree.expression) list -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_field : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_setfield : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_array : Ppxlib_ast__.Import.Parsetree.expression list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_ifthenelse : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_sequence : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_while : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_for : Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Asttypes.direction_flag -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_constraint : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_coerce : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.core_type option -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_send : Ppxlib_ast__.Import.Parsetree.expression -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_new : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_setinstvar : string Location.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_override : (string Location.loc * Ppxlib_ast__.Import.Parsetree.expression) list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_letmodule : string Location.loc -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_letexception : Ppxlib_ast__.Import.Parsetree.extension_constructor -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_assert : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_lazy : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_poly : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.core_type option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_object : Ppxlib_ast__.Import.Parsetree.class_structure -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_newtype : string Location.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_pack : Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_open : Ppxlib_ast__.Import.Parsetree.module_expr Ppxlib_ast__.Import.Parsetree.open_infos -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_letop : Ppxlib_ast__.Import.Parsetree.letop -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_unreachable : Ppxlib_ast__.Import.Parsetree.expression
val extension_constructor : name:string Location.loc -> kind:Ppxlib_ast__.Import.Parsetree.extension_constructor_kind -> Ppxlib_ast__.Import.Parsetree.extension_constructor
val include_infos : 'a -> 'a Ppxlib_ast__.Import.Parsetree.include_infos
val label_declaration : name:string Location.loc -> mutable_:Ppxlib_ast__.Import.Asttypes.mutable_flag -> type_:Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.label_declaration
val letop : let_:Ppxlib_ast__.Import.Parsetree.binding_op -> ands:Ppxlib_ast__.Import.Parsetree.binding_op list -> body:Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.letop
val location : start:Stdlib.Lexing.position -> end_:Stdlib.Lexing.position -> ghost:bool -> Warnings.loc
val module_binding : name:string Location.loc -> expr:Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_binding
val module_declaration : name:string Location.loc -> type_:Ppxlib_ast__.Import.Parsetree.module_type -> Ppxlib_ast__.Import.Parsetree.module_declaration
val pmod_ident : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_structure : Ppxlib_ast__.Import.Parsetree.structure_item list -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_functor : string Location.loc -> Ppxlib_ast__.Import.Parsetree.module_type option -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_apply : Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_constraint : Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_type -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_unpack : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.module_expr
val module_substitution : name:string Location.loc -> manifest:Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_substitution
val pmty_ident : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_signature : Ppxlib_ast__.Import.Parsetree.signature_item list -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_functor : string Location.loc -> Ppxlib_ast__.Import.Parsetree.module_type option -> Ppxlib_ast__.Import.Parsetree.module_type -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_with : Ppxlib_ast__.Import.Parsetree.module_type -> Ppxlib_ast__.Import.Parsetree.with_constraint list -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_typeof : Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_alias : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_type
val module_type_declaration : name:string Location.loc -> type_:Ppxlib_ast__.Import.Parsetree.module_type option -> Ppxlib_ast__.Import.Parsetree.module_type_declaration
val otag : string Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.object_field
val oinherit : Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.object_field
val open_infos : expr:'a -> override:Ppxlib_ast__.Import.Asttypes.override_flag -> 'a Ppxlib_ast__.Import.Parsetree.open_infos
val ppat_any : Ppxlib_ast__.Import.Parsetree.pattern
val ppat_var : string Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_alias : Ppxlib_ast__.Import.Parsetree.pattern -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_constant : Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_interval : Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_tuple : Ppxlib_ast__.Import.Parsetree.pattern list -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_construct : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern option -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_variant : string -> Ppxlib_ast__.Import.Parsetree.pattern option -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_record : (Ppxlib_ast__.Import.Longident.t Location.loc * Ppxlib_ast__.Import.Parsetree.pattern) list -> Ppxlib_ast__.Import.Asttypes.closed_flag -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_array : Ppxlib_ast__.Import.Parsetree.pattern list -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_or : Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_constraint : Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_type : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_lazy : Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_unpack : string Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_exception : Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_open : Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern
val position : fname:string -> lnum:int -> bol:int -> cnum:int -> Stdlib.Lexing.position
val rtag : string Location.loc -> bool -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.row_field
val rinherit : Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.row_field
val psig_value : Ppxlib_ast__.Import.Parsetree.value_description -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_type : Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.type_declaration list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_typesubst : Ppxlib_ast__.Import.Parsetree.type_declaration list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_typext : Ppxlib_ast__.Import.Parsetree.type_extension -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_exception : Ppxlib_ast__.Import.Parsetree.type_exception -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_module : Ppxlib_ast__.Import.Parsetree.module_declaration -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_modsubst : Ppxlib_ast__.Import.Parsetree.module_substitution -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_recmodule : Ppxlib_ast__.Import.Parsetree.module_declaration list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_modtype : Ppxlib_ast__.Import.Parsetree.module_type_declaration -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_open : Ppxlib_ast__.Import.Longident.t Location.loc Ppxlib_ast__.Import.Parsetree.open_infos -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_include : Ppxlib_ast__.Import.Parsetree.module_type Ppxlib_ast__.Import.Parsetree.include_infos -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_class : Ppxlib_ast__.Import.Parsetree.class_type Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_class_type : Ppxlib_ast__.Import.Parsetree.class_type Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_attribute : Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.attribute list -> Ppxlib_ast__.Import.Parsetree.signature_item
val pstr_eval : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.attribute list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_value : Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.value_binding list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_primitive : Ppxlib_ast__.Import.Parsetree.value_description -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_type : Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.type_declaration list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_typext : Ppxlib_ast__.Import.Parsetree.type_extension -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_exception : Ppxlib_ast__.Import.Parsetree.type_exception -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_module : Ppxlib_ast__.Import.Parsetree.module_binding -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_recmodule : Ppxlib_ast__.Import.Parsetree.module_binding list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_modtype : Ppxlib_ast__.Import.Parsetree.module_type_declaration -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_open : Ppxlib_ast__.Import.Parsetree.module_expr Ppxlib_ast__.Import.Parsetree.open_infos -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_class : Ppxlib_ast__.Import.Parsetree.class_expr Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_class_type : Ppxlib_ast__.Import.Parsetree.class_type Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_include : Ppxlib_ast__.Import.Parsetree.module_expr Ppxlib_ast__.Import.Parsetree.include_infos -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_attribute : Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_extension : (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.attribute list -> Ppxlib_ast__.Import.Parsetree.structure_item
val toplevel_directive : name:string Location.loc -> arg:Ppxlib_ast__.Import.Parsetree.directive_argument option -> Ppxlib_ast__.Import.Parsetree.toplevel_directive
val type_declaration : name:string Location.loc -> params: (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Asttypes.variance) list -> cstrs: (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Parsetree.core_type * Warnings.loc) list -> kind:Ppxlib_ast__.Import.Parsetree.type_kind -> private_:Ppxlib_ast__.Import.Asttypes.private_flag -> manifest:Ppxlib_ast__.Import.Parsetree.core_type option -> Ppxlib_ast__.Import.Parsetree.type_declaration
val type_exception : Ppxlib_ast__.Import.Parsetree.extension_constructor -> Ppxlib_ast__.Import.Parsetree.type_exception
val type_extension : path:Ppxlib_ast__.Import.Longident.t Location.loc -> params: (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Asttypes.variance) list -> constructors:Ppxlib_ast__.Import.Parsetree.extension_constructor list -> private_:Ppxlib_ast__.Import.Asttypes.private_flag -> Ppxlib_ast__.Import.Parsetree.type_extension
val value_binding : pat:Ppxlib_ast__.Import.Parsetree.pattern -> expr:Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.value_binding
val value_description : name:string Location.loc -> type_:Ppxlib_ast__.Import.Parsetree.core_type -> prim:string list -> Ppxlib_ast__.Import.Parsetree.value_description
val eint : Base.Int.t -> Ppxlib_ast__.Import.Parsetree.expression
val echar : Base.Char.t -> Ppxlib_ast__.Import.Parsetree.expression
val estring : Base.String.t -> Ppxlib_ast__.Import.Parsetree.expression
val efloat : Base.String.t -> Ppxlib_ast__.Import.Parsetree.expression
val eint32 : Base.Int32.t -> Ppxlib_ast__.Import.Parsetree.expression
val eint64 : Base.Int64.t -> Ppxlib_ast__.Import.Parsetree.expression
val enativeint : Base.Nativeint.t -> Ppxlib_ast__.Import.Parsetree.expression
val ebool : Base.Bool.t -> Ppxlib_ast__.Import.Parsetree.expression
val pint : Base.Int.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pchar : Base.Char.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pstring : Base.String.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pfloat : Base.String.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pint32 : Base.Int32.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pint64 : Base.Int64.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pnativeint : Base.Nativeint.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pbool : Base.Bool.t -> Ppxlib_ast__.Import.Parsetree.pattern
val eunit : Ppxlib_ast__.Import.Parsetree.expression
val punit : Ppxlib_ast__.Import.Parsetree.pattern
val evar : Base.String.t -> Ppxlib_ast__.Import.Parsetree.expression

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 : Base.String.t -> Ppxlib_ast__.Import.Parsetree.pattern
val eapply : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression

Same as pexp_apply but without labels

val eabstract : Ppxlib_ast__.Import.Parsetree.pattern Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val esequence : Ppxlib_ast__.Import.Parsetree.expression Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression
val ppat_tuple_opt : Ppxlib_ast__.Import.Parsetree.pattern Base.List.t -> Ppxlib_ast__.Import.Parsetree.pattern Base.Option.t
val pexp_tuple_opt : Ppxlib_ast__.Import.Parsetree.expression Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression Base.Option.t
val pconstruct : Ppxlib_ast__.Import.Parsetree.constructor_declaration -> Ppxlib_ast__.Import.Parsetree.pattern Base.Option.t -> Ppxlib_ast__.Import.Parsetree.pattern
val econstruct : Ppxlib_ast__.Import.Parsetree.constructor_declaration -> Ppxlib_ast__.Import.Parsetree.expression Base.Option.t -> Ppxlib_ast__.Import.Parsetree.expression
val elist : Ppxlib_ast__.Import.Parsetree.expression Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression
val plist : Ppxlib_ast__.Import.Parsetree.pattern Base.List.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pstr_value_list : loc:Location.t -> Ppxlib__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.value_binding Base.List.t -> Ppxlib_ast__.Import.Parsetree.structure_item Base.List.t

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

val nonrec_type_declaration : name:Base.String.t Loc.t -> params: (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib__.Import.Asttypes.variance) Base.List.t -> cstrs: (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Parsetree.core_type * Location.t) Base.List.t -> kind:Ppxlib_ast__.Import.Parsetree.type_kind -> private_:Ppxlib__.Import.Asttypes.private_flag -> manifest:Ppxlib_ast__.Import.Parsetree.core_type Base.Option.t -> Ppxlib_ast__.Import.Parsetree.type_declaration
  • deprecated [since 2016-10] use Nonrecursive on the P(str|sig)_type instead
val unapplied_type_constr_conv : Longident.t Loc.t -> f:(Base.String.t -> Base.String.t) -> Ppxlib_ast__.Import.Parsetree.expression

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.
val type_constr_conv : Longident.t Loc.t -> f:(Base.String.t -> Base.String.t) -> Ppxlib_ast__.Import.Parsetree.expression Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression
val eta_reduce : Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression Base.Option.t

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:

  • if f has optional arguments, eta-expanding f can drop them
  • because labels commute, it can change the type of an expression: $ let f ~x y = x + y let f2 = fun x -> add x;; val f : x:int -> int -> int = <fun> val f2 : int -> x:int -> int = <fun> In fact, if f 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_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val eta_reduce_if_possible_and_nonrec : Ppxlib_ast__.Import.Parsetree.expression -> rec_flag:Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.expression
OCaml

Innovation. Community. Security.