package ppxlib

  1. Overview
  2. Docs

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

module Located : sig ... end
val attribute : loc:Warnings.loc -> name:string Location.loc -> payload:Ppxlib_ast__.Import.Parsetree.payload -> Ppxlib_ast__.Import.Parsetree.attribute
val binding_op : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_structure : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_structure -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_fun : loc:Warnings.loc -> 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 : loc:Warnings.loc -> 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 : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_expr -> Ppxlib_ast__.Import.Parsetree.class_type -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_expr
val pcl_open : loc:Warnings.loc -> 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 : loc:Warnings.loc -> 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 : loc:Warnings.loc -> (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 : loc:Warnings.loc -> (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 : loc:Warnings.loc -> (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Parsetree.core_type) -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_initializer : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_attribute : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.class_field
val pcf_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_field
val class_infos : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.class_type
val pcty_signature : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_signature -> Ppxlib_ast__.Import.Parsetree.class_type
val pcty_arrow : loc:Warnings.loc -> 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 : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_type
val pcty_open : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_type -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_val : loc:Warnings.loc -> (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 : loc:Warnings.loc -> (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 : loc:Warnings.loc -> (Ppxlib_ast__.Import.Parsetree.core_type * Ppxlib_ast__.Import.Parsetree.core_type) -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_attribute : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.class_type_field
val pctf_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.class_type_field
val constructor_declaration : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_var : loc:Warnings.loc -> string -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_arrow : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_constr : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_object : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.object_field list -> Ppxlib_ast__.Import.Asttypes.closed_flag -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_class : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_alias : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.core_type -> string -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_variant : loc:Warnings.loc -> 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 : loc:Warnings.loc -> string Location.loc list -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.core_type
val ptyp_package : loc:Warnings.loc -> (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 : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.core_type
val pdir_string : loc:Warnings.loc -> string -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pdir_int : loc:Warnings.loc -> string -> char option -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pdir_ident : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pdir_bool : loc:Warnings.loc -> bool -> Ppxlib_ast__.Import.Parsetree.directive_argument
val pexp_ident : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_constant : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_let : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.case list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_fun : loc:Warnings.loc -> 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 : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.case list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_try : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.case list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_tuple : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_construct : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_variant : loc:Warnings.loc -> string -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_record : loc:Warnings.loc -> (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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_setfield : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_ifthenelse : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_sequence : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_while : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_for : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_coerce : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_new : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_setinstvar : loc:Warnings.loc -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_override : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.expression) list -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_letmodule : loc:Warnings.loc -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_letexception : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.extension_constructor -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_assert : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_lazy : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_poly : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.core_type option -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_object : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_structure -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_newtype : loc:Warnings.loc -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_pack : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_open : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.letop -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.expression
val pexp_unreachable : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression
val extension_constructor : loc:Warnings.loc -> name:string Location.loc -> kind:Ppxlib_ast__.Import.Parsetree.extension_constructor_kind -> Ppxlib_ast__.Import.Parsetree.extension_constructor
val include_infos : loc:Warnings.loc -> 'a -> 'a Ppxlib_ast__.Import.Parsetree.include_infos
val label_declaration : loc:Warnings.loc -> 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 : loc:Warnings.loc -> name:string Location.loc -> expr:Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_binding
val module_declaration : loc:Warnings.loc -> name:string Location.loc -> type_:Ppxlib_ast__.Import.Parsetree.module_type -> Ppxlib_ast__.Import.Parsetree.module_declaration
val pmod_ident : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_structure : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.structure_item list -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_functor : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_constraint : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_type -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_unpack : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.module_expr
val pmod_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.module_expr
val module_substitution : loc:Warnings.loc -> name:string Location.loc -> manifest:Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_substitution
val pmty_ident : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_signature : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.signature_item list -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_functor : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_type -> Ppxlib_ast__.Import.Parsetree.with_constraint list -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_typeof : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_expr -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.module_type
val pmty_alias : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.module_type
val module_type_declaration : loc:Warnings.loc -> name:string Location.loc -> type_:Ppxlib_ast__.Import.Parsetree.module_type option -> Ppxlib_ast__.Import.Parsetree.module_type_declaration
val otag : loc:Warnings.loc -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.object_field
val oinherit : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.object_field
val open_infos : loc:Warnings.loc -> expr:'a -> override:Ppxlib_ast__.Import.Asttypes.override_flag -> 'a Ppxlib_ast__.Import.Parsetree.open_infos
val ppat_any : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_var : loc:Warnings.loc -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_alias : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_constant : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_interval : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.constant -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_tuple : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern list -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_construct : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern option -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_variant : loc:Warnings.loc -> string -> Ppxlib_ast__.Import.Parsetree.pattern option -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_record : loc:Warnings.loc -> (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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern list -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_or : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_constraint : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_type : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_lazy : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_unpack : loc:Warnings.loc -> string Location.loc -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_exception : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.pattern -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.pattern
val ppat_open : loc:Warnings.loc -> 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 : loc:Warnings.loc -> string Location.loc -> bool -> Ppxlib_ast__.Import.Parsetree.core_type list -> Ppxlib_ast__.Import.Parsetree.row_field
val rinherit : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.core_type -> Ppxlib_ast__.Import.Parsetree.row_field
val psig_value : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.value_description -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_type : loc:Warnings.loc -> Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.type_declaration list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_typesubst : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.type_declaration list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_typext : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.type_extension -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_exception : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.type_exception -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_module : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_declaration -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_modsubst : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_substitution -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_recmodule : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_declaration list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_modtype : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_type_declaration -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_open : loc:Warnings.loc -> Ppxlib_ast__.Import.Longident.t Location.loc Ppxlib_ast__.Import.Parsetree.open_infos -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_include : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_type Ppxlib_ast__.Import.Parsetree.include_infos -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_class : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_type Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_class_type : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_type Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_attribute : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.signature_item
val psig_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.attribute list -> Ppxlib_ast__.Import.Parsetree.signature_item
val pstr_eval : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.attribute list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_value : loc:Warnings.loc -> Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.value_binding list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_primitive : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.value_description -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_type : loc:Warnings.loc -> Ppxlib_ast__.Import.Asttypes.rec_flag -> Ppxlib_ast__.Import.Parsetree.type_declaration list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_typext : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.type_extension -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_exception : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.type_exception -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_module : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_binding -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_recmodule : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_binding list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_modtype : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_type_declaration -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_open : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_expr Ppxlib_ast__.Import.Parsetree.open_infos -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_class : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_expr Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_class_type : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.class_type Ppxlib_ast__.Import.Parsetree.class_infos list -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_include : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.module_expr Ppxlib_ast__.Import.Parsetree.include_infos -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_attribute : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.attribute -> Ppxlib_ast__.Import.Parsetree.structure_item
val pstr_extension : loc:Warnings.loc -> (string Location.loc * Ppxlib_ast__.Import.Parsetree.payload) -> Ppxlib_ast__.Import.Parsetree.attribute list -> Ppxlib_ast__.Import.Parsetree.structure_item
val toplevel_directive : loc:Warnings.loc -> name:string Location.loc -> arg:Ppxlib_ast__.Import.Parsetree.directive_argument option -> Ppxlib_ast__.Import.Parsetree.toplevel_directive
val type_declaration : loc:Warnings.loc -> 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 : loc:Warnings.loc -> Ppxlib_ast__.Import.Parsetree.extension_constructor -> Ppxlib_ast__.Import.Parsetree.type_exception
val type_extension : loc:Warnings.loc -> 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 : loc:Warnings.loc -> pat:Ppxlib_ast__.Import.Parsetree.pattern -> expr:Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.value_binding
val value_description : loc:Warnings.loc -> name:string Location.loc -> type_:Ppxlib_ast__.Import.Parsetree.core_type -> prim:string list -> Ppxlib_ast__.Import.Parsetree.value_description
val eint : loc:Location.t -> Base.Int.t -> Ppxlib_ast__.Import.Parsetree.expression
val echar : loc:Location.t -> Base.Char.t -> Ppxlib_ast__.Import.Parsetree.expression
val estring : loc:Location.t -> Base.String.t -> Ppxlib_ast__.Import.Parsetree.expression
val efloat : loc:Location.t -> Base.String.t -> Ppxlib_ast__.Import.Parsetree.expression
val eint32 : loc:Location.t -> Base.Int32.t -> Ppxlib_ast__.Import.Parsetree.expression
val eint64 : loc:Location.t -> Base.Int64.t -> Ppxlib_ast__.Import.Parsetree.expression
val enativeint : loc:Location.t -> Base.Nativeint.t -> Ppxlib_ast__.Import.Parsetree.expression
val ebool : loc:Location.t -> Base.Bool.t -> Ppxlib_ast__.Import.Parsetree.expression
val pint : loc:Location.t -> Base.Int.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pchar : loc:Location.t -> Base.Char.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pstring : loc:Location.t -> Base.String.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pfloat : loc:Location.t -> Base.String.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pint32 : loc:Location.t -> Base.Int32.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pint64 : loc:Location.t -> Base.Int64.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pnativeint : loc:Location.t -> Base.Nativeint.t -> Ppxlib_ast__.Import.Parsetree.pattern
val pbool : loc:Location.t -> Base.Bool.t -> Ppxlib_ast__.Import.Parsetree.pattern
val eunit : loc:Location.t -> Ppxlib_ast__.Import.Parsetree.expression
val punit : loc:Location.t -> Ppxlib_ast__.Import.Parsetree.pattern
val evar : loc:Location.t -> 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 : loc:Location.t -> Base.String.t -> Ppxlib_ast__.Import.Parsetree.pattern
val eapply : loc:Location.t -> 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 : loc:Location.t -> Ppxlib_ast__.Import.Parsetree.pattern Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression -> Ppxlib_ast__.Import.Parsetree.expression
val esequence : loc:Location.t -> Ppxlib_ast__.Import.Parsetree.expression Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression
val ppat_tuple_opt : loc:Location.t -> Ppxlib_ast__.Import.Parsetree.pattern Base.List.t -> Ppxlib_ast__.Import.Parsetree.pattern Base.Option.t
val pexp_tuple_opt : loc:Location.t -> 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 : loc:Location.t -> Ppxlib_ast__.Import.Parsetree.expression Base.List.t -> Ppxlib_ast__.Import.Parsetree.expression
val plist : loc:Location.t -> 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 : loc:Location.t -> 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 : loc:Location.t -> 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 : loc:Location.t -> 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.