Generic combinators
Sourceval parse :
('a, 'b, 'c) t ->
Location.t ->
?on_error:(string -> 'c) ->
'a ->
'b ->
'c Matches a value against a pattern.
Sourceval as__ : ('a, 'b, 'c) t -> ('a, 'a -> 'b, 'c) t Sourceval __ : ('a, 'a -> 'b, 'b) t Pattern that captures its input.
Sourceval __' : ('a, 'a Location.loc -> 'b, 'b) t Pattern that captures its input with location.
Sourceval nil : ('a list, 'b, 'b) t Sourceval (^::) : ('a, 'b, 'c) t -> ('a list, 'c, 'd) t -> ('a list, 'b, 'd) t Sourceval none : ('a option, 'b, 'b) t Sourceval some : ('a, 'b, 'c) t -> ('a option, 'b, 'c) t Sourceval pair : ('a, 'b, 'c) t -> ('d, 'c, 'e) t -> ('a * 'd, 'b, 'e) t Sourceval (**) : ('a, 'b, 'c) t -> ('d, 'c, 'e) t -> ('a * 'd, 'b, 'e) t Sourceval (|||) : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t Sourceval loc : ('a, 'b, 'c) t -> ('a Location.loc, 'b, 'c) t Sourceval (>>|) : ('a, 'b, 'c) t -> ('d -> 'b) -> ('a, 'd, 'c) t Sourceval list : ('a, 'b -> 'b, 'c) t -> ('a list, 'c list -> 'd, 'd) t Mapping results of applying pattern-combinator
Sourceval map : ('a, 'b, 'c) t -> f:('d -> 'b) -> ('a, 'd, 'c) t Sourceval map0 : ('a, 'b, 'c) t -> f:'d -> ('a, 'd -> 'b, 'c) t Sourceval map1 : ('a, 'b -> 'c, 'd) t -> f:('b -> 'e) -> ('a, 'e -> 'c, 'd) t Sourceval map2 :
('a, 'b -> 'c -> 'd, 'e) t ->
f:('b -> 'c -> 'f) ->
('a, 'f -> 'd, 'e) t Sourceval map3 :
('a, 'b -> 'c -> 'd -> 'e, 'f) t ->
f:('b -> 'c -> 'd -> 'g) ->
('a, 'g -> 'e, 'f) t Sourceval map4 :
('a, 'b -> 'c -> 'd -> 'e -> 'f, 'g) t ->
f:('b -> 'c -> 'd -> 'e -> 'h) ->
('a, 'h -> 'f, 'g) t Sourceval map5 :
('a, 'b -> 'c -> 'd -> 'e -> 'f -> 'g, 'h) t ->
f:('b -> 'c -> 'd -> 'e -> 'f -> 'i) ->
('a, 'i -> 'g, 'h) t Sourceval map6 :
('a, 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h, 'i) t ->
f:('b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'j) ->
('a, 'j -> 'h, 'i) t Sourceval map7 :
('a, 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i, 'j) t ->
f:('b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'k) ->
('a, 'k -> 'i, 'j) t Sourceval map_result : ('a, 'b, 'c) t -> f:('c -> 'd) -> ('a, 'b, 'd) t Sourceval int : int -> (int, 'a, 'a) t Sourceval string : string -> (string, 'a, 'a) t Sourceval lident : (string, 'a, 'b) t -> (Longident.t, 'a, 'b) t Sourceval elongident : Longident.t -> (Longident.t, 'a, 'a) t Sourceval path : string list -> (Path.t, 'a, 'a) t Sourceval path_pident : (Ident.t, 'a, 'b) t -> (Path.t, 'a, 'b) t Sourceval eint : (int, 'a, 'b) t -> (Typedtree.expression, 'a, 'b) t Sourceval ebool : (Typedtree.expression, bool -> 'a, 'a) t Sourceval estring : (Typedtree.expression, string -> 'a, 'a) t Sourceval econst : (Asttypes.constant, 'a, 'b) t -> (Typedtree.expression, 'a, 'b) t Typedtree-specific combinators
Sourcetype case_val = Typedtree.value Typedtree.case Sourcetype case_comp = Typedtree.computation Typedtree.case Sourcetype value_pat = Typedtree.value Typedtree.pattern_desc Typedtree.pattern_data Sourcetype comp_pat =
Typedtree.computation Typedtree.pattern_desc Typedtree.pattern_data Sourceval nolabel : (Asttypes.arg_label, 'a, 'a) t Sourceval labelled : (string, 'a, 'b) t -> (Asttypes.arg_label, 'a, 'b) t Sourceval tpat_var : (string, 'a, 'b) t -> (Typedtree.pattern, 'a, 'b) t Sourceval tpat_id : (Ident.t, 'a, 'b) t -> (Typedtree.pattern, 'a, 'b) t Sourceval tpat_tuple :
(Typedtree.value Typedtree.general_pattern list, 'a, 'b) t ->
(Typedtree.value Typedtree.pattern_desc Typedtree.pattern_data, 'a, 'b) t Sourceval tpat_constructor :
(Longident.t, 'a, 'b) t ->
(Typedtree.pattern list, 'b, 'c) t ->
(Typedtree.pattern, 'a, 'c) t Sourceval pident : (string, 'a, 'b) t -> (Path.t, 'a, 'b) t Sourceval texp_ident : (Path.t, 'a, 'b) t -> (Typedtree.expression, 'a, 'b) t Trying to parse identifier with a given path. Beware that standard function are locted implicitly in Stdlib module. For example
texp_ident (path "&&" ) (* WRONG *) texp_ident (path "Stdlib"; "&&" ) (* CORRECT *)
Sourceval texp_ident_loc :
(Path.t, 'a, 'b) t ->
(Typedtree.expression, Warnings.loc -> 'a, 'b) t Sourceval texp_ident_typ :
(Path.t, 'a, 'b) t ->
(Types.type_expr, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_assert :
(Typedtree.expression, 'a, 'b) t ->
(Typedtree.expression, 'a, 'b) t Sourceval texp_let :
(Typedtree.value_binding list, 'a, 'b) t ->
(Typedtree.expression, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_apply :
(Typedtree.expression, 'a, 'b) t ->
((Asttypes.arg_label * Typedtree.expression option) list, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_apply1 :
(Typedtree.expression, 'a, 'b) t ->
(Typedtree.expression, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_apply2 :
(Typedtree.expression, 'a, 'b) t ->
(Typedtree.expression, 'b, 'c) t ->
(Typedtree.expression, 'c, 'd) t ->
(Typedtree.expression, 'a, 'd) t Sourceval texp_apply_nolabelled :
(Typedtree.expression, 'a, 'b) t ->
(Typedtree.expression list, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_function_body :
((Asttypes.arg_label * (Ident.t * Location.t)) list, 'a, 'b) t ->
(Typedtree.expression, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_function_cases :
((Asttypes.arg_label * (Ident.t * Location.t)) list, 'a, 'b) t ->
(Typedtree.value Typedtree.case list, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval case :
(Typedtree.pattern, 'a, 'b) t ->
(Typedtree.expression option, 'b, 'c) t ->
(Typedtree.expression, 'c, 'd) t ->
(case_val, 'a, 'd) t Sourceval ccase :
(comp_pat, 'a, 'b) t ->
(Typedtree.expression option, 'b, 'c) t ->
(Typedtree.expression, 'c, 'd) t ->
(case_comp, 'a, 'd) t Sourceval texp_construct :
(Longident.t, 'a, 'b) t ->
(Types.constructor_description, 'b, 'c) t ->
(Typedtree.expression list, 'c, 'd) t ->
(Typedtree.expression, 'a, 'd) t Sourceval texp_match :
(Typedtree.expression, 'a, 'b) t ->
(case_comp list, 'b, 'c) t ->
(case_val list, 'c, 'd) t ->
(Typedtree.expression, 'a, 'd) t Sourceval texp_ite :
(Typedtree.expression, 'a, 'b) t ->
(Typedtree.expression, 'b, 'c) t ->
(Typedtree.expression option, 'c, 'd) t ->
(Typedtree.expression, 'a, 'd) t Sourceval texp_try :
(Typedtree.expression, 'a, 'b) t ->
(case_val list, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_record :
(Typedtree.expression option, 'a, 'b) t ->
((Types.label_description * Typedtree.record_label_definition) array, 'b, 'c)
t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_field :
(Typedtree.expression, 'a, 'b) t ->
(Types.label_description, 'b, 'c) t ->
(Typedtree.expression, 'a, 'c) t Sourceval texp_assert_false : unit -> (Typedtree.expression, 'a, 'a) t Sourceval label_desc : (string, 'a, 'b) t -> (Types.label_description, 'a, 'b) t Sourceval rld_kept : (Typedtree.record_label_definition, 'a, 'a) t Sourceval rld_overriden :
(Longident.t, 'a, 'b) t ->
(Typedtree.expression, 'b, 'c) t ->
(Typedtree.record_label_definition, 'a, 'c) t Sourceval value_binding :
(Typedtree.pattern, 'a, 'b) t ->
(Typedtree.expression, 'b, 'c) t ->
(Typedtree.value_binding, 'a, 'c) t Sourceval typ_constr :
(Path.t, 'a, 'b) t ->
(Types.type_expr list, 'b, 'c) t ->
(Types.type_expr, 'a, 'c) t Sourceval typ_arrow :
(Types.type_expr, 'a, 'b) t ->
(Types.type_expr, 'b, 'c) t ->
(Types.type_expr, 'a, 'c) t Sourceval typ_kind_abstract : (Typedtree.type_kind, 'c, 'c) t Sourceval typ_kind_open : (Typedtree.type_kind, 'c, 'c) t Sourceval typ_kind_variant : (Typedtree.type_kind, 'c, 'c) t Sourceval typ_kind_record :
(Typedtree.label_declaration list, 'b, 'c) t ->
(Typedtree.type_kind, 'b, 'c) t Sourceval core_typ : (Types.type_expr, 'a, 'b) t -> (Typedtree.core_type, 'a, 'b) t Sourceval tstr_attribute :
(Typedtree.attribute, 'a, 'b) t ->
(Typedtree.structure_item, 'a, 'b) t Sourceval tsig_attribute :
(Typedtree.attribute, 'a, 'b) t ->
(Typedtree.signature_item, 'a, 'b) t Sourceval tsig_val_name : (Ident.t, 'a, 'b) t -> (Typedtree.signature_item, 'a, 'b) t Sourceval attribute :
(string, 'a, 'b) t ->
(Parsetree.payload, 'b, 'c) t ->
(Typedtree.attribute, 'a, 'c) t Sourceval tstr_docattr : (string, 'a, 'b) t -> (Typedtree.structure_item, 'a, 'b) t Sourceval tsig_docattr : (string, 'a, 'b) t -> (Typedtree.signature_item, 'a, 'b) t Sourceval of_func : (context -> Location.t -> 'a -> 'b -> 'c) -> ('a, 'b, 'c) t Sourceval to_func : ('a, 'b, 'c) t -> context -> Location.t -> 'a -> 'b -> 'c Sourceval fail : Warnings.loc -> string -> 'a Sourceval pexp_function_body :
(Parsetree.pattern list, 'a, 'b) t ->
(Parsetree.expression, 'b, 'c) t ->
(Parsetree.expression, 'a, 'c) t Sourceval pexp_function_cases :
(Parsetree.pattern list, 'a, 'b) t ->
(Parsetree.case list, 'b, 'c) t ->
(Parsetree.expression, 'a, 'c) t Sourceval pexp_apply :
(Parsetree.expression, 'a, 'b) t ->
((Asttypes.arg_label * Parsetree.expression) list, 'b, 'c) t ->
(Parsetree.expression, 'a, 'c) t