Up

Module Ast_pattern

First class AST patterns

Signature

PPX rewriters often need to recognize fragments the OCaml AST, for instance to parse the payload of an attribute/expression. You can do that with a pattern matching and manual error reporting when the input is not what you expect but this has proven to quickly become extremely verbose and unreadable.

This module aims to help with that by providing first class AST patterns.

To understand how to use it, let's consider the example of ppx_inline_test. We want to recognize patterns of the form:


      let%test "name" = expr
    

Which is a syntactic sugar for:


      [%%test let "name" = expr]
    

If we wanted to write a function that recognizes the payload of %%test using normal pattern matching we would write:


      let match_payload = function
        | Pstr [ { pstr_desc = Pstr_value (Nonrecursive,
                                           [ { pvb_pat = Ppat_constant (Constant_string
                                                                          (name, None))
                                             ; pvb_expr = e
                                             ; _ } ])
                 ; _ } ] ->
          (name, e)
        | _ -> Location.raise_errorf ...
    

This is quite cumbersome, and this is still not right: this function drops all attributes without notice.

Now let's imagine we wanted to construct the payload instead, using Ast_builder one would write:


      let build_payload ~loc name expr =
        let (module B) = Ast_builder.with_loc loc in
        let open B in
        pstr [ pstr_value Nonrecursive (value_binding ~pat:(pstring name) ~expr) ]
    

Constructing a first class pattern is almost as simple as replacing Ast_builder by Ast_pattern:


      let payload_pattern name expr =
        let open Ast_pattern in
        pstr (pstr_value nonrecursive (value_binding ~pat:(pstring __) ~expr:__) ^:: nil)
    

Notice that the place-holders for name and expr have been replaced by __. The following pattern with have type:

 (payload, string -> expression -> 'a, 'a) Ast_pattern.t 

which means that it matches values of type payload and captures a string and expression from it. The two captured elements comes from the use of __.

type ('a, 'b, 'c) t = ('a, 'b, 'c) Ast_pattern0.t

Type of a pattern:

  • 'a is the type of value matched by the pattern
  • 'b is the continuation, for instance for a pattern that captures an int and a string, 'b will be int -> string -> _
  • 'c is the result of the continuation.
val parse : ('a, 'b, 'c) t -> Location.t -> 'a -> 'b -> 'c

Matches a value against a pattern.

module Packed : sig .. end
val __ : ('a, 'a -> 'b, 'b) t

Pattern that captures its input.

val __' : ('a, 'a Location.loc -> 'b, 'b) t

Same as __ but also captures the location.

Note: this should only be used for types that do not embed a location. For instance you can use it to capture a string constant:


      estring __'
    

but using it to capture an expression would not yield the expected result:


      pair (eint (int 42)) __'
    

In the latter case you should use the pexp_loc field of the captured expression instead.

val alt : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t

alt stands for `alternatives'. It matches either the first pattern or the second one.

val (|||) : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t

Same as alt

val map : ('a, 'b, 'c) t -> f:('d -> 'b) -> ('a, 'd, 'c) t
val map' : ('a, 'b, 'c) t -> f:(Location.t -> 'd -> 'b) -> ('a, 'd, 'c) t
val map_result : ('a, 'b, 'c) t -> f:('c -> 'd) -> ('a, 'b, 'd) t
val (>>|) : ('a, 'b, 'c) t -> ('d -> 'b) -> ('a, 'd, 'c) t

Same as map

val (^::) : ('a, 'b, 'c) t -> ('a list, 'c, 'd) t -> ('a list, 'b, 'd) t
val many : ('a, 'b -> 'b, 'c) t -> ('a list, 'c list -> 'd, 'd) t
val int : int -> (int, 'a, 'a) t
val char : char -> (char, 'a, 'a) t
val string : string -> (string, 'a, 'a) t
val float : float -> (float, 'a, 'a) t
val int32 : int32 -> (int32, 'a, 'a) t
val int64 : int64 -> (int64, 'a, 'a) t
val nativeint : nativeint -> (nativeint, 'a, 'a) t
val bool : bool -> (bool, 'a, 'a) t
val cst : to_string:('a -> string) -> ?equal:('a -> 'a -> bool) -> 'a -> ('a, 'b, 'b) t
val pair : ('a1, 'b, 'c) t -> ('a2, 'c, 'd) t -> ('a1 * 'a2, 'b, 'd) t
val (**) : ('a1, 'b, 'c) t -> ('a2, 'c, 'd) t -> ('a1 * 'a2, 'b, 'd) t
val triple : ('a1, 'b, 'c) t -> ('a2, 'c, 'd) t -> ('a3, 'd, 'e) t -> ('a1 * 'a2 * 'a3, 'b, 'e) t
val loc : ('a, 'b, 'c) t -> ('a Location.loc, 'b, 'c) t
val pack0 : ('a, 'b, 'c) t -> ('a, unit -> 'b, 'c) t
val pack2 : ('a, 'b -> 'c -> 'd, 'e) t -> ('a, 'b * 'c -> 'd, 'e) t
val pack3 : ('a, 'b -> 'c -> 'd -> 'e, 'f) t -> ('a, 'b * 'c * 'd -> 'e, 'f) t
include module type of Ast_pattern_generated
val false_ : (bool, 'a, 'a) Ast_pattern0.t
val true_ : (bool, 'a, 'a) Ast_pattern0.t
val case : lhs:(Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> guard:(Parsetree.expression option, 'b, 'c) Ast_pattern0.t -> rhs:(Parsetree.expression, 'c, 'd) Ast_pattern0.t -> (Parsetree.case, 'a, 'd) Ast_pattern0.t
val pcl_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_expr, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'c) Ast_pattern0.t
val pcl_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_expr, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'c) Ast_pattern0.t
val pcl_constr : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type list, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'c) Ast_pattern0.t
val pcl_structure : (Parsetree.class_structure, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'b) Ast_pattern0.t
val pcl_fun : (Asttypes.label, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression option, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'c, 'd) Ast_pattern0.t -> (Parsetree.class_expr, 'd, 'e) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'e) Ast_pattern0.t
val pcl_apply : (Parsetree.class_expr, 'a, 'b) Ast_pattern0.t -> ((Asttypes.label * Parsetree.expression) list, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'c) Ast_pattern0.t
val pcl_let : (Asttypes.rec_flag, 'a, 'b) Ast_pattern0.t -> (Parsetree.value_binding list, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_expr, 'c, 'd) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'd) Ast_pattern0.t
val pcl_constraint : (Parsetree.class_expr, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'c) Ast_pattern0.t
val pcl_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_expr, 'a, 'b) Ast_pattern0.t
val pcf_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'c) Ast_pattern0.t
val pcf_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'c) Ast_pattern0.t
val pcf_inherit : (Asttypes.override_flag, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_expr, 'b, 'c) Ast_pattern0.t -> (string option, 'c, 'd) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'd) Ast_pattern0.t
val pcf_val : (string Asttypes.loc * Asttypes.mutable_flag * Parsetree.class_field_kind, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'b) Ast_pattern0.t
val pcf_method : (string Asttypes.loc * Asttypes.private_flag * Parsetree.class_field_kind, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'b) Ast_pattern0.t
val pcf_constraint : (Parsetree.core_type * Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'b) Ast_pattern0.t
val pcf_initializer : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'b) Ast_pattern0.t
val pcf_attribute : (Parsetree.attribute, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'b) Ast_pattern0.t
val pcf_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field, 'a, 'b) Ast_pattern0.t
val cfk_virtual : (Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_field_kind, 'a, 'b) Ast_pattern0.t
val cfk_concrete : (Asttypes.override_flag, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_field_kind, 'a, 'c) Ast_pattern0.t
val class_infos_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> ('c Parsetree.class_infos, 'b, 'd) Ast_pattern0.t -> ('c Parsetree.class_infos, 'a, 'd) Ast_pattern0.t
val class_infos : virt:(Asttypes.virtual_flag, 'a, 'b) Ast_pattern0.t -> params:((Parsetree.core_type * Asttypes.variance) list, 'b, 'c) Ast_pattern0.t -> name:(string, 'c, 'd) Ast_pattern0.t -> expr:('e, 'd, 'f) Ast_pattern0.t -> ('e Parsetree.class_infos, 'a, 'f) Ast_pattern0.t
val class_signature : self:(Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> fields:(Parsetree.class_type_field list, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_signature, 'a, 'c) Ast_pattern0.t
val class_structure : self:(Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> fields:(Parsetree.class_field list, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_structure, 'a, 'c) Ast_pattern0.t
val pcty_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_type, 'a, 'c) Ast_pattern0.t
val pcty_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_type, 'a, 'c) Ast_pattern0.t
val pcty_constr : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type list, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_type, 'a, 'c) Ast_pattern0.t
val pcty_signature : (Parsetree.class_signature, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type, 'a, 'b) Ast_pattern0.t
val pcty_arrow : (Asttypes.label, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_type, 'c, 'd) Ast_pattern0.t -> (Parsetree.class_type, 'a, 'd) Ast_pattern0.t
val pcty_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type, 'a, 'b) Ast_pattern0.t
val pctf_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'c) Ast_pattern0.t
val pctf_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'b, 'c) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'c) Ast_pattern0.t
val pctf_inherit : (Parsetree.class_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'b) Ast_pattern0.t
val pctf_val : (string * Asttypes.mutable_flag * Asttypes.virtual_flag * Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'b) Ast_pattern0.t
val pctf_method : (string * Asttypes.private_flag * Asttypes.virtual_flag * Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'b) Ast_pattern0.t
val pctf_constraint : (Parsetree.core_type * Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'b) Ast_pattern0.t
val pctf_attribute : (Parsetree.attribute, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'b) Ast_pattern0.t
val pctf_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.class_type_field, 'a, 'b) Ast_pattern0.t
val closed : (Asttypes.closed_flag, 'a, 'a) Ast_pattern0.t
val open_ : (Asttypes.closed_flag, 'a, 'a) Ast_pattern0.t
val const_int : (int, 'a, 'b) Ast_pattern0.t -> (Asttypes.constant, 'a, 'b) Ast_pattern0.t
val const_char : (char, 'a, 'b) Ast_pattern0.t -> (Asttypes.constant, 'a, 'b) Ast_pattern0.t
val const_string : (string, 'a, 'b) Ast_pattern0.t -> (string option, 'b, 'c) Ast_pattern0.t -> (Asttypes.constant, 'a, 'c) Ast_pattern0.t
val const_float : (string, 'a, 'b) Ast_pattern0.t -> (Asttypes.constant, 'a, 'b) Ast_pattern0.t
val const_int32 : (int32, 'a, 'b) Ast_pattern0.t -> (Asttypes.constant, 'a, 'b) Ast_pattern0.t
val const_int64 : (int64, 'a, 'b) Ast_pattern0.t -> (Asttypes.constant, 'a, 'b) Ast_pattern0.t
val const_nativeint : (nativeint, 'a, 'b) Ast_pattern0.t -> (Asttypes.constant, 'a, 'b) Ast_pattern0.t
val constructor_declaration_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.constructor_declaration, 'b, 'c) Ast_pattern0.t -> (Parsetree.constructor_declaration, 'a, 'c) Ast_pattern0.t
val constructor_declaration : name:(string, 'a, 'b) Ast_pattern0.t -> args:(Parsetree.core_type list, 'b, 'c) Ast_pattern0.t -> res:(Parsetree.core_type option, 'c, 'd) Ast_pattern0.t -> (Parsetree.constructor_declaration, 'a, 'd) Ast_pattern0.t
val ptyp_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'c) Ast_pattern0.t
val ptyp_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'c) Ast_pattern0.t
val ptyp_any : (Parsetree.core_type, 'a, 'a) Ast_pattern0.t
val ptyp_var : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'b) Ast_pattern0.t
val ptyp_arrow : (Asttypes.label, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'c, 'd) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'd) Ast_pattern0.t
val ptyp_tuple : (Parsetree.core_type list, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'b) Ast_pattern0.t
val ptyp_constr : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type list, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'c) Ast_pattern0.t
val ptyp_object : ((string * Parsetree.attributes * Parsetree.core_type) list, 'a, 'b) Ast_pattern0.t -> (Asttypes.closed_flag, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'c) Ast_pattern0.t
val ptyp_class : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type list, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'c) Ast_pattern0.t
val ptyp_alias : (Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (string, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'c) Ast_pattern0.t
val ptyp_variant : (Parsetree.row_field list, 'a, 'b) Ast_pattern0.t -> (Asttypes.closed_flag, 'b, 'c) Ast_pattern0.t -> (Asttypes.label list option, 'c, 'd) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'd) Ast_pattern0.t
val ptyp_poly : (string list, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'c) Ast_pattern0.t
val ptyp_package : (Parsetree.package_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'b) Ast_pattern0.t
val ptyp_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'a, 'b) Ast_pattern0.t
val upto : (Asttypes.direction_flag, 'a, 'a) Ast_pattern0.t
val downto_ : (Asttypes.direction_flag, 'a, 'a) Ast_pattern0.t
val pdir_none : (Parsetree.directive_argument, 'a, 'a) Ast_pattern0.t
val pdir_string : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.directive_argument, 'a, 'b) Ast_pattern0.t
val pdir_int : (int, 'a, 'b) Ast_pattern0.t -> (Parsetree.directive_argument, 'a, 'b) Ast_pattern0.t
val pdir_ident : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.directive_argument, 'a, 'b) Ast_pattern0.t
val pdir_bool : (bool, 'a, 'b) Ast_pattern0.t -> (Parsetree.directive_argument, 'a, 'b) Ast_pattern0.t
val pexp_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_ident : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_constant : (Asttypes.constant, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_let : (Asttypes.rec_flag, 'a, 'b) Ast_pattern0.t -> (Parsetree.value_binding list, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'c, 'd) Ast_pattern0.t -> (Parsetree.expression, 'a, 'd) Ast_pattern0.t
val pexp_function : (Parsetree.case list, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_fun : (Asttypes.label, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression option, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'c, 'd) Ast_pattern0.t -> (Parsetree.expression, 'd, 'e) Ast_pattern0.t -> (Parsetree.expression, 'a, 'e) Ast_pattern0.t
val pexp_apply : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> ((Asttypes.label * Parsetree.expression) list, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_match : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.case list, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_try : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.case list, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_tuple : (Parsetree.expression list, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_construct : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression option, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_variant : (Asttypes.label, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression option, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_record : ((Longident.t Asttypes.loc * Parsetree.expression) list, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression option, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_field : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Longident.t, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_setfield : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Longident.t, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'c, 'd) Ast_pattern0.t -> (Parsetree.expression, 'a, 'd) Ast_pattern0.t
val pexp_array : (Parsetree.expression list, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_ifthenelse : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression option, 'c, 'd) Ast_pattern0.t -> (Parsetree.expression, 'a, 'd) Ast_pattern0.t
val pexp_sequence : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_while : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_for : (Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'c, 'd) Ast_pattern0.t -> (Asttypes.direction_flag, 'd, 'e) Ast_pattern0.t -> (Parsetree.expression, 'e, 'f) Ast_pattern0.t -> (Parsetree.expression, 'a, 'f) Ast_pattern0.t
val pexp_constraint : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_coerce : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type option, 'b, 'c) Ast_pattern0.t -> (Parsetree.core_type, 'c, 'd) Ast_pattern0.t -> (Parsetree.expression, 'a, 'd) Ast_pattern0.t
val pexp_send : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (string, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_new : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_setinstvar : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_override : ((string Asttypes.loc * Parsetree.expression) list, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_letmodule : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'c, 'd) Ast_pattern0.t -> (Parsetree.expression, 'a, 'd) Ast_pattern0.t
val pexp_assert : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_lazy : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_poly : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type option, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_object : (Parsetree.class_structure, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_newtype : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'a, 'c) Ast_pattern0.t
val pexp_pack : (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val pexp_open : (Asttypes.override_flag, 'a, 'b) Ast_pattern0.t -> (Longident.t, 'b, 'c) Ast_pattern0.t -> (Parsetree.expression, 'c, 'd) Ast_pattern0.t -> (Parsetree.expression, 'a, 'd) Ast_pattern0.t
val pexp_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression, 'a, 'b) Ast_pattern0.t
val extension_constructor_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.extension_constructor, 'b, 'c) Ast_pattern0.t -> (Parsetree.extension_constructor, 'a, 'c) Ast_pattern0.t
val extension_constructor : name:(string, 'a, 'b) Ast_pattern0.t -> kind:(Parsetree.extension_constructor_kind, 'b, 'c) Ast_pattern0.t -> (Parsetree.extension_constructor, 'a, 'c) Ast_pattern0.t
val pext_decl : (Parsetree.core_type list, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type option, 'b, 'c) Ast_pattern0.t -> (Parsetree.extension_constructor_kind, 'a, 'c) Ast_pattern0.t
val pext_rebind : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.extension_constructor_kind, 'a, 'b) Ast_pattern0.t
val include_infos_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> ('c Parsetree.include_infos, 'b, 'd) Ast_pattern0.t -> ('c Parsetree.include_infos, 'a, 'd) Ast_pattern0.t
val include_infos : mod_:('a, 'b, 'c) Ast_pattern0.t -> ('a Parsetree.include_infos, 'b, 'c) Ast_pattern0.t
val label_declaration_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.label_declaration, 'b, 'c) Ast_pattern0.t -> (Parsetree.label_declaration, 'a, 'c) Ast_pattern0.t
val label_declaration : name:(string, 'a, 'b) Ast_pattern0.t -> mutable_:(Asttypes.mutable_flag, 'b, 'c) Ast_pattern0.t -> type_:(Parsetree.core_type, 'c, 'd) Ast_pattern0.t -> (Parsetree.label_declaration, 'a, 'd) Ast_pattern0.t
val lexing_position : fname:(string, 'a, 'b) Ast_pattern0.t -> lnum:(int, 'b, 'c) Ast_pattern0.t -> bol:(int, 'c, 'd) Ast_pattern0.t -> cnum:(int, 'd, 'e) Ast_pattern0.t -> (Lexing.position, 'a, 'e) Ast_pattern0.t
val nil : ('a list, 'b, 'b) Ast_pattern0.t
val cons : ('a, 'b, 'c) Ast_pattern0.t -> ('a list, 'c, 'd) Ast_pattern0.t -> ('a list, 'b, 'd) Ast_pattern0.t
val location : start:(Lexing.position, 'a, 'b) Ast_pattern0.t -> end_:(Lexing.position, 'b, 'c) Ast_pattern0.t -> ghost:(bool, 'c, 'd) Ast_pattern0.t -> (Location.t, 'a, 'd) Ast_pattern0.t
val lident : (string, 'a, 'b) Ast_pattern0.t -> (Longident.t, 'a, 'b) Ast_pattern0.t
val ldot : (Longident.t, 'a, 'b) Ast_pattern0.t -> (string, 'b, 'c) Ast_pattern0.t -> (Longident.t, 'a, 'c) Ast_pattern0.t
val lapply : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Longident.t, 'b, 'c) Ast_pattern0.t -> (Longident.t, 'a, 'c) Ast_pattern0.t
val module_binding_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_binding, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_binding, 'a, 'c) Ast_pattern0.t
val module_binding : name:(string, 'a, 'b) Ast_pattern0.t -> expr:(Parsetree.module_expr, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_binding, 'a, 'c) Ast_pattern0.t
val module_declaration_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_declaration, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_declaration, 'a, 'c) Ast_pattern0.t
val module_declaration : name:(string, 'a, 'b) Ast_pattern0.t -> type_:(Parsetree.module_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_declaration, 'a, 'c) Ast_pattern0.t
val pmod_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'c) Ast_pattern0.t
val pmod_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'c) Ast_pattern0.t
val pmod_ident : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t
val pmod_structure : (Parsetree.structure, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t
val pmod_functor : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type option, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_expr, 'c, 'd) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'd) Ast_pattern0.t
val pmod_apply : (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'c) Ast_pattern0.t
val pmod_constraint : (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'c) Ast_pattern0.t
val pmod_unpack : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t
val pmod_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t
val pmty_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'c) Ast_pattern0.t
val pmty_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'c) Ast_pattern0.t
val pmty_ident : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'b) Ast_pattern0.t
val pmty_signature : (Parsetree.signature, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'b) Ast_pattern0.t
val pmty_functor : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type option, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_type, 'c, 'd) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'd) Ast_pattern0.t
val pmty_with : (Parsetree.module_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.with_constraint list, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'c) Ast_pattern0.t
val pmty_typeof : (Parsetree.module_expr, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'b) Ast_pattern0.t
val pmty_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'b) Ast_pattern0.t
val pmty_alias : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type, 'a, 'b) Ast_pattern0.t
val module_type_declaration_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.module_type_declaration, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_type_declaration, 'a, 'c) Ast_pattern0.t
val module_type_declaration : name:(string, 'a, 'b) Ast_pattern0.t -> type_:(Parsetree.module_type option, 'b, 'c) Ast_pattern0.t -> (Parsetree.module_type_declaration, 'a, 'c) Ast_pattern0.t
val immutable : (Asttypes.mutable_flag, 'a, 'a) Ast_pattern0.t
val mutable_ : (Asttypes.mutable_flag, 'a, 'a) Ast_pattern0.t
val open_description_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.open_description, 'b, 'c) Ast_pattern0.t -> (Parsetree.open_description, 'a, 'c) Ast_pattern0.t
val open_description : lid:(Longident.t, 'a, 'b) Ast_pattern0.t -> override:(Asttypes.override_flag, 'b, 'c) Ast_pattern0.t -> (Parsetree.open_description, 'a, 'c) Ast_pattern0.t
val none : ('a option, 'b, 'b) Ast_pattern0.t
val some : ('a, 'b, 'c) Ast_pattern0.t -> ('a option, 'b, 'c) Ast_pattern0.t
val override : (Asttypes.override_flag, 'a, 'a) Ast_pattern0.t
val fresh : (Asttypes.override_flag, 'a, 'a) Ast_pattern0.t
val ppat_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_any : (Parsetree.pattern, 'a, 'a) Ast_pattern0.t
val ppat_var : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_alias : (Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> (string, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_constant : (Asttypes.constant, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_interval : (Asttypes.constant, 'a, 'b) Ast_pattern0.t -> (Asttypes.constant, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_tuple : (Parsetree.pattern list, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_construct : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern option, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_variant : (Asttypes.label, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern option, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_record : ((Longident.t Asttypes.loc * Parsetree.pattern) list, 'a, 'b) Ast_pattern0.t -> (Asttypes.closed_flag, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_array : (Parsetree.pattern list, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_or : (Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_constraint : (Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> (Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'c) Ast_pattern0.t
val ppat_type : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_lazy : (Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_unpack : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_exception : (Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val ppat_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.pattern, 'a, 'b) Ast_pattern0.t
val pstr : (Parsetree.structure, 'a, 'b) Ast_pattern0.t -> (Parsetree.payload, 'a, 'b) Ast_pattern0.t
val ptyp : (Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.payload, 'a, 'b) Ast_pattern0.t
val ppat : (Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> (Parsetree.expression option, 'b, 'c) Ast_pattern0.t -> (Parsetree.payload, 'a, 'c) Ast_pattern0.t
val private_ : (Asttypes.private_flag, 'a, 'a) Ast_pattern0.t
val public : (Asttypes.private_flag, 'a, 'a) Ast_pattern0.t
val nonrecursive : (Asttypes.rec_flag, 'a, 'a) Ast_pattern0.t
val recursive : (Asttypes.rec_flag, 'a, 'a) Ast_pattern0.t
val rtag : (Asttypes.label, 'a, 'b) Ast_pattern0.t -> (Parsetree.attributes, 'b, 'c) Ast_pattern0.t -> (bool, 'c, 'd) Ast_pattern0.t -> (Parsetree.core_type list, 'd, 'e) Ast_pattern0.t -> (Parsetree.row_field, 'a, 'e) Ast_pattern0.t
val rinherit : (Parsetree.core_type, 'a, 'b) Ast_pattern0.t -> (Parsetree.row_field, 'a, 'b) Ast_pattern0.t
val psig_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'b, 'c) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'c) Ast_pattern0.t
val psig_value : (Parsetree.value_description, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_type : (Parsetree.type_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_typext : (Parsetree.type_extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_exception : (Parsetree.extension_constructor, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_module : (Parsetree.module_declaration, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_recmodule : (Parsetree.module_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_modtype : (Parsetree.module_type_declaration, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_open : (Parsetree.open_description, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_include : (Parsetree.include_description, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_class : (Parsetree.class_description list, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_class_type : (Parsetree.class_type_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_attribute : (Parsetree.attribute, 'a, 'b) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'b) Ast_pattern0.t
val psig_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.attributes, 'b, 'c) Ast_pattern0.t -> (Parsetree.signature_item, 'a, 'c) Ast_pattern0.t
val pstr_loc : (Location.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'b, 'c) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'c) Ast_pattern0.t
val pstr_eval : (Parsetree.expression, 'a, 'b) Ast_pattern0.t -> (Parsetree.attributes, 'b, 'c) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'c) Ast_pattern0.t
val pstr_value : (Asttypes.rec_flag, 'a, 'b) Ast_pattern0.t -> (Parsetree.value_binding list, 'b, 'c) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'c) Ast_pattern0.t
val pstr_primitive : (Parsetree.value_description, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_type : (Parsetree.type_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_typext : (Parsetree.type_extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_exception : (Parsetree.extension_constructor, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_module : (Parsetree.module_binding, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_recmodule : (Parsetree.module_binding list, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_modtype : (Parsetree.module_type_declaration, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_open : (Parsetree.open_description, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_class : (Parsetree.class_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_class_type : (Parsetree.class_type_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_include : (Parsetree.include_declaration, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_attribute : (Parsetree.attribute, 'a, 'b) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'b) Ast_pattern0.t
val pstr_extension : (Parsetree.extension, 'a, 'b) Ast_pattern0.t -> (Parsetree.attributes, 'b, 'c) Ast_pattern0.t -> (Parsetree.structure_item, 'a, 'c) Ast_pattern0.t
val ptop_def : (Parsetree.structure, 'a, 'b) Ast_pattern0.t -> (Parsetree.toplevel_phrase, 'a, 'b) Ast_pattern0.t
val ptop_dir : (string, 'a, 'b) Ast_pattern0.t -> (Parsetree.directive_argument, 'b, 'c) Ast_pattern0.t -> (Parsetree.toplevel_phrase, 'a, 'c) Ast_pattern0.t
val type_declaration_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.type_declaration, 'b, 'c) Ast_pattern0.t -> (Parsetree.type_declaration, 'a, 'c) Ast_pattern0.t
val type_declaration : name:(string, 'a, 'b) Ast_pattern0.t -> params:((Parsetree.core_type * Asttypes.variance) list, 'b, 'c) Ast_pattern0.t -> cstrs:((Parsetree.core_type * Parsetree.core_type * Location.t) list, 'c, 'd) Ast_pattern0.t -> kind:(Parsetree.type_kind, 'd, 'e) Ast_pattern0.t -> private_:(Asttypes.private_flag, 'e, 'f) Ast_pattern0.t -> manifest:(Parsetree.core_type option, 'f, 'g) Ast_pattern0.t -> (Parsetree.type_declaration, 'a, 'g) Ast_pattern0.t
val type_extension_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.type_extension, 'b, 'c) Ast_pattern0.t -> (Parsetree.type_extension, 'a, 'c) Ast_pattern0.t
val type_extension : path:(Longident.t, 'a, 'b) Ast_pattern0.t -> params:((Parsetree.core_type * Asttypes.variance) list, 'b, 'c) Ast_pattern0.t -> constructors:(Parsetree.extension_constructor list, 'c, 'd) Ast_pattern0.t -> private_:(Asttypes.private_flag, 'd, 'e) Ast_pattern0.t -> (Parsetree.type_extension, 'a, 'e) Ast_pattern0.t
val ptype_abstract : (Parsetree.type_kind, 'a, 'a) Ast_pattern0.t
val ptype_variant : (Parsetree.constructor_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.type_kind, 'a, 'b) Ast_pattern0.t
val ptype_record : (Parsetree.label_declaration list, 'a, 'b) Ast_pattern0.t -> (Parsetree.type_kind, 'a, 'b) Ast_pattern0.t
val ptype_open : (Parsetree.type_kind, 'a, 'a) Ast_pattern0.t
val value_binding_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.value_binding, 'b, 'c) Ast_pattern0.t -> (Parsetree.value_binding, 'a, 'c) Ast_pattern0.t
val value_binding : pat:(Parsetree.pattern, 'a, 'b) Ast_pattern0.t -> expr:(Parsetree.expression, 'b, 'c) Ast_pattern0.t -> (Parsetree.value_binding, 'a, 'c) Ast_pattern0.t
val value_description_attributes : (Parsetree.attributes, 'a, 'b) Ast_pattern0.t -> (Parsetree.value_description, 'b, 'c) Ast_pattern0.t -> (Parsetree.value_description, 'a, 'c) Ast_pattern0.t
val value_description : name:(string, 'a, 'b) Ast_pattern0.t -> type_:(Parsetree.core_type, 'b, 'c) Ast_pattern0.t -> prim:(string list, 'c, 'd) Ast_pattern0.t -> (Parsetree.value_description, 'a, 'd) Ast_pattern0.t
val covariant : (Asttypes.variance, 'a, 'a) Ast_pattern0.t
val contravariant : (Asttypes.variance, 'a, 'a) Ast_pattern0.t
val invariant : (Asttypes.variance, 'a, 'a) Ast_pattern0.t
val virtual_ : (Asttypes.virtual_flag, 'a, 'a) Ast_pattern0.t
val concrete : (Asttypes.virtual_flag, 'a, 'a) Ast_pattern0.t
val pwith_type : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Parsetree.type_declaration, 'b, 'c) Ast_pattern0.t -> (Parsetree.with_constraint, 'a, 'c) Ast_pattern0.t
val pwith_module : (Longident.t, 'a, 'b) Ast_pattern0.t -> (Longident.t, 'b, 'c) Ast_pattern0.t -> (Parsetree.with_constraint, 'a, 'c) Ast_pattern0.t
val pwith_typesubst : (Parsetree.type_declaration, 'a, 'b) Ast_pattern0.t -> (Parsetree.with_constraint, 'a, 'b) Ast_pattern0.t
val pwith_modsubst : (string, 'a, 'b) Ast_pattern0.t -> (Longident.t, 'b, 'c) Ast_pattern0.t -> (Parsetree.with_constraint, 'a, 'c) Ast_pattern0.t
val eint : (int, 'a, 'b) t -> (Parsetree.expression, 'a, 'b) t
val echar : (char, 'a, 'b) t -> (Parsetree.expression, 'a, 'b) t
val estring : (string, 'a, 'b) t -> (Parsetree.expression, 'a, 'b) t
val efloat : (string, 'a, 'b) t -> (Parsetree.expression, 'a, 'b) t
val eint32 : (int32, 'a, 'b) t -> (Parsetree.expression, 'a, 'b) t
val eint64 : (int64, 'a, 'b) t -> (Parsetree.expression, 'a, 'b) t
val enativeint : (nativeint, 'a, 'b) t -> (Parsetree.expression, 'a, 'b) t
val pint : (int, 'a, 'b) t -> (Parsetree.pattern, 'a, 'b) t
val pchar : (char, 'a, 'b) t -> (Parsetree.pattern, 'a, 'b) t
val pstring : (string, 'a, 'b) t -> (Parsetree.pattern, 'a, 'b) t
val pfloat : (string, 'a, 'b) t -> (Parsetree.pattern, 'a, 'b) t
val pint32 : (int32, 'a, 'b) t -> (Parsetree.pattern, 'a, 'b) t
val pint64 : (int64, 'a, 'b) t -> (Parsetree.pattern, 'a, 'b) t
val pnativeint : (nativeint, 'a, 'b) t -> (Parsetree.pattern, 'a, 'b) t
val single_expr_payload : (Parsetree.expression, 'a, 'b) t -> (Parsetree.payload, 'a, 'b) t
val no_label : (Parsetree.expression, 'a, 'b) t -> (string * Parsetree.expression, 'a, 'b) t
val attribute : (string, 'a, 'b) t -> (Parsetree.payload, 'b, 'c) t -> (Parsetree.attribute, 'a, 'c) t
val extension : (string, 'a, 'b) t -> (Parsetree.payload, 'b, 'c) t -> (Parsetree.attribute, 'a, 'c) t
type context
val of_func : (context -> Location.t -> 'a -> 'b -> 'c) -> ('a, 'b, 'c) t
val to_func : ('a, 'b, 'c) t -> context -> Location.t -> 'a -> 'b -> 'c