To focus the search input from anywhere on the page, press the 'S' key.
in-package search v0.1.0
Library
Module
Module type
Parameter
Class
Class type
module Located : sig ... end
include sig ... end
val loc : Ppxlib.Location.t
val case :
lhs:Migrate_parsetree.Ast_407.Parsetree.pattern ->
guard:Migrate_parsetree.Ast_407.Parsetree.expression option ->
rhs:Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.case
val pcl_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.class_expr
val pcf_inherit :
Migrate_parsetree.Ast_407.Asttypes.override_flag ->
Migrate_parsetree.Ast_407.Parsetree.class_expr ->
string Location.loc option ->
Migrate_parsetree.Ast_407.Parsetree.class_field
val pcf_initializer :
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.class_field
val pcf_attribute :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.class_field
val pcf_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.class_field
val class_infos :
virt:Migrate_parsetree.Ast_407.Asttypes.virtual_flag ->
params:
(Migrate_parsetree.Ast_407.Parsetree.core_type
* Migrate_parsetree.Ast_407.Asttypes.variance)
list ->
name:string Location.loc ->
expr:'a ->
'a Migrate_parsetree.Ast_407.Parsetree.class_infos
val class_signature :
self:Migrate_parsetree.Ast_407.Parsetree.core_type ->
fields:Migrate_parsetree.Ast_407.Parsetree.class_type_field list ->
Migrate_parsetree.Ast_407.Parsetree.class_signature
val class_structure :
self:Migrate_parsetree.Ast_407.Parsetree.pattern ->
fields:Migrate_parsetree.Ast_407.Parsetree.class_field list ->
Migrate_parsetree.Ast_407.Parsetree.class_structure
val pcty_constr :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.core_type list ->
Migrate_parsetree.Ast_407.Parsetree.class_type
val pcty_signature :
Migrate_parsetree.Ast_407.Parsetree.class_signature ->
Migrate_parsetree.Ast_407.Parsetree.class_type
val pcty_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.class_type
val pctf_attribute :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.class_type_field
val pctf_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.class_type_field
val constructor_declaration :
name:string Location.loc ->
args:Migrate_parsetree.Ast_407.Parsetree.constructor_arguments ->
res:Migrate_parsetree.Ast_407.Parsetree.core_type option ->
Migrate_parsetree.Ast_407.Parsetree.constructor_declaration
val ptyp_any : Migrate_parsetree.Ast_407.Parsetree.core_type
val ptyp_var : string -> Migrate_parsetree.Ast_407.Parsetree.core_type
val ptyp_tuple :
Migrate_parsetree.Ast_407.Parsetree.core_type list ->
Migrate_parsetree.Ast_407.Parsetree.core_type
val ptyp_constr :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.core_type list ->
Migrate_parsetree.Ast_407.Parsetree.core_type
val ptyp_alias :
Migrate_parsetree.Ast_407.Parsetree.core_type ->
string ->
Migrate_parsetree.Ast_407.Parsetree.core_type
val ptyp_variant :
Migrate_parsetree.Ast_407.Parsetree.row_field list ->
Migrate_parsetree.Ast_407.Asttypes.closed_flag ->
string list option ->
Migrate_parsetree.Ast_407.Parsetree.core_type
val ptyp_poly :
string Location.loc list ->
Migrate_parsetree.Ast_407.Parsetree.core_type ->
Migrate_parsetree.Ast_407.Parsetree.core_type
val ptyp_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.core_type
val pexp_ident :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_constant :
Migrate_parsetree.Ast_407.Parsetree.constant ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_function :
Migrate_parsetree.Ast_407.Parsetree.case list ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_tuple :
Migrate_parsetree.Ast_407.Parsetree.expression list ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_construct :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.expression option ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_variant :
string ->
Migrate_parsetree.Ast_407.Parsetree.expression option ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_record :
(Ocaml_common.Longident.t Location.loc
* Migrate_parsetree.Ast_407.Parsetree.expression)
list ->
Migrate_parsetree.Ast_407.Parsetree.expression option ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_array :
Migrate_parsetree.Ast_407.Parsetree.expression list ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_for :
Migrate_parsetree.Ast_407.Parsetree.pattern ->
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Asttypes.direction_flag ->
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_send :
Migrate_parsetree.Ast_407.Parsetree.expression ->
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_setinstvar :
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_override :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.expression) list ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_letmodule :
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.module_expr ->
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_newtype :
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.expression
val pexp_unreachable : Migrate_parsetree.Ast_407.Parsetree.expression
val extension_constructor :
name:string Location.loc ->
kind:Migrate_parsetree.Ast_407.Parsetree.extension_constructor_kind ->
Migrate_parsetree.Ast_407.Parsetree.extension_constructor
val include_infos : 'a -> 'a Migrate_parsetree.Ast_407.Parsetree.include_infos
val label_declaration :
name:string Location.loc ->
mutable_:Migrate_parsetree.Ast_407.Asttypes.mutable_flag ->
type_:Migrate_parsetree.Ast_407.Parsetree.core_type ->
Migrate_parsetree.Ast_407.Parsetree.label_declaration
val location :
start:Lexing.position ->
end_:Lexing.position ->
ghost:bool ->
Warnings.loc
val module_binding :
name:string Location.loc ->
expr:Migrate_parsetree.Ast_407.Parsetree.module_expr ->
Migrate_parsetree.Ast_407.Parsetree.module_binding
val module_declaration :
name:string Location.loc ->
type_:Migrate_parsetree.Ast_407.Parsetree.module_type ->
Migrate_parsetree.Ast_407.Parsetree.module_declaration
val pmod_ident :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.module_expr
val pmod_structure :
Migrate_parsetree.Ast_407.Parsetree.structure_item list ->
Migrate_parsetree.Ast_407.Parsetree.module_expr
val pmod_functor :
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.module_type option ->
Migrate_parsetree.Ast_407.Parsetree.module_expr ->
Migrate_parsetree.Ast_407.Parsetree.module_expr
val pmod_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.module_expr
val pmty_ident :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.module_type
val pmty_signature :
Migrate_parsetree.Ast_407.Parsetree.signature_item list ->
Migrate_parsetree.Ast_407.Parsetree.module_type
val pmty_functor :
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.module_type option ->
Migrate_parsetree.Ast_407.Parsetree.module_type ->
Migrate_parsetree.Ast_407.Parsetree.module_type
val pmty_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.module_type
val pmty_alias :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.module_type
val module_type_declaration :
name:string Location.loc ->
type_:Migrate_parsetree.Ast_407.Parsetree.module_type option ->
Migrate_parsetree.Ast_407.Parsetree.module_type_declaration
val open_description :
lid:Ocaml_common.Longident.t Location.loc ->
override:Migrate_parsetree.Ast_407.Asttypes.override_flag ->
Migrate_parsetree.Ast_407.Parsetree.open_description
val ppat_any : Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_var :
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_alias :
Migrate_parsetree.Ast_407.Parsetree.pattern ->
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_constant :
Migrate_parsetree.Ast_407.Parsetree.constant ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_tuple :
Migrate_parsetree.Ast_407.Parsetree.pattern list ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_construct :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.pattern option ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_variant :
string ->
Migrate_parsetree.Ast_407.Parsetree.pattern option ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_array :
Migrate_parsetree.Ast_407.Parsetree.pattern list ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_type :
Ocaml_common.Longident.t Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_unpack :
string Location.loc ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_exception :
Migrate_parsetree.Ast_407.Parsetree.pattern ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val ppat_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val position :
fname:string ->
lnum:int ->
bol:int ->
cnum:int ->
Lexing.position
val psig_recmodule :
Migrate_parsetree.Ast_407.Parsetree.module_declaration list ->
Migrate_parsetree.Ast_407.Parsetree.signature_item
val psig_attribute :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.signature_item
val psig_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) list ->
Migrate_parsetree.Ast_407.Parsetree.signature_item
val pstr_eval :
Migrate_parsetree.Ast_407.Parsetree.expression ->
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) list ->
Migrate_parsetree.Ast_407.Parsetree.structure_item
val pstr_recmodule :
Migrate_parsetree.Ast_407.Parsetree.module_binding list ->
Migrate_parsetree.Ast_407.Parsetree.structure_item
val pstr_attribute :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
Migrate_parsetree.Ast_407.Parsetree.structure_item
val pstr_extension :
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) ->
(string Location.loc * Migrate_parsetree.Ast_407.Parsetree.payload) list ->
Migrate_parsetree.Ast_407.Parsetree.structure_item
val type_declaration :
name:string Location.loc ->
params:
(Migrate_parsetree.Ast_407.Parsetree.core_type
* Migrate_parsetree.Ast_407.Asttypes.variance)
list ->
cstrs:
(Migrate_parsetree.Ast_407.Parsetree.core_type
* Migrate_parsetree.Ast_407.Parsetree.core_type
* Warnings.loc)
list ->
kind:Migrate_parsetree.Ast_407.Parsetree.type_kind ->
private_:Migrate_parsetree.Ast_407.Asttypes.private_flag ->
manifest:Migrate_parsetree.Ast_407.Parsetree.core_type option ->
Migrate_parsetree.Ast_407.Parsetree.type_declaration
val type_extension :
path:Ocaml_common.Longident.t Location.loc ->
params:
(Migrate_parsetree.Ast_407.Parsetree.core_type
* Migrate_parsetree.Ast_407.Asttypes.variance)
list ->
constructors:Migrate_parsetree.Ast_407.Parsetree.extension_constructor list ->
private_:Migrate_parsetree.Ast_407.Asttypes.private_flag ->
Migrate_parsetree.Ast_407.Parsetree.type_extension
val value_binding :
pat:Migrate_parsetree.Ast_407.Parsetree.pattern ->
expr:Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.value_binding
val value_description :
name:string Location.loc ->
type_:Migrate_parsetree.Ast_407.Parsetree.core_type ->
prim:string list ->
Migrate_parsetree.Ast_407.Parsetree.value_description
val eint : Base.Int.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val echar : Base.Char.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val estring : Base.String.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val efloat : Base.String.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val eint32 : Base.Int32.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val eint64 : Base.Int64.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val enativeint :
Base.Nativeint.t ->
Migrate_parsetree.Ast_407.Parsetree.expression
val ebool : Base.Bool.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val pint : Base.Int.t -> Migrate_parsetree.Ast_407.Parsetree.pattern
val pchar : Base.Char.t -> Migrate_parsetree.Ast_407.Parsetree.pattern
val pstring : Base.String.t -> Migrate_parsetree.Ast_407.Parsetree.pattern
val pfloat : Base.String.t -> Migrate_parsetree.Ast_407.Parsetree.pattern
val pint32 : Base.Int32.t -> Migrate_parsetree.Ast_407.Parsetree.pattern
val pint64 : Base.Int64.t -> Migrate_parsetree.Ast_407.Parsetree.pattern
val pnativeint :
Base.Nativeint.t ->
Migrate_parsetree.Ast_407.Parsetree.pattern
val pbool : Base.Bool.t -> Migrate_parsetree.Ast_407.Parsetree.pattern
val eunit : Migrate_parsetree.Ast_407.Parsetree.expression
val punit : Migrate_parsetree.Ast_407.Parsetree.pattern
val evar : Base.String.t -> Migrate_parsetree.Ast_407.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 eapply :
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.expression Base.List.t ->
Migrate_parsetree.Ast_407.Parsetree.expression
Same as pexp_apply but without labels
val pstr_value_list :
loc:Ppxlib.Location.t ->
Ppxlib_ast.Asttypes.rec_flag ->
Migrate_parsetree.Ast_407.Parsetree.value_binding Base.List.t ->
Migrate_parsetree.Ast_407.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 Ppxlib.Loc.t ->
params:
(Migrate_parsetree.Ast_407.Parsetree.core_type
* Ppxlib_ast.Asttypes.variance)
Base.List.t ->
cstrs:
(Migrate_parsetree.Ast_407.Parsetree.core_type
* Migrate_parsetree.Ast_407.Parsetree.core_type
* Ppxlib.Location.t)
Base.List.t ->
kind:Migrate_parsetree.Ast_407.Parsetree.type_kind ->
private_:Ppxlib_ast.Asttypes.private_flag ->
manifest:Migrate_parsetree.Ast_407.Parsetree.core_type Base.Option.t ->
Migrate_parsetree.Ast_407.Parsetree.type_declaration
val unapplied_type_constr_conv :
Ppxlib.Longident.t Ppxlib.Loc.t ->
f:(Base.String.t -> Base.String.t) ->
Migrate_parsetree.Ast_407.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 :
Ppxlib.Longident.t Ppxlib.Loc.t ->
f:(Base.String.t -> Base.String.t) ->
Migrate_parsetree.Ast_407.Parsetree.expression Base.List.t ->
Migrate_parsetree.Ast_407.Parsetree.expression
val eta_reduce :
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.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-expandingf
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 :
Migrate_parsetree.Ast_407.Parsetree.expression ->
Migrate_parsetree.Ast_407.Parsetree.expression
val eta_reduce_if_possible_and_nonrec :
Migrate_parsetree.Ast_407.Parsetree.expression ->
rec_flag:Migrate_parsetree.Ast_407.Asttypes.rec_flag ->
Migrate_parsetree.Ast_407.Parsetree.expression
val elident : Base.String.t -> Migrate_parsetree.Ast_407.Parsetree.expression
val econstr :
Base.String.t ->
Migrate_parsetree.Ast_407.Parsetree.expression list ->
Migrate_parsetree.Ast_407.Parsetree.expression
val enil : unit -> Migrate_parsetree.Ast_407.Parsetree.expression
val pvar : string -> Migrate_parsetree.Ast_407.Parsetree.pattern