Up

Module type Additional_helpers

Signature

type 'a with_loc
val eint : (int -> Parsetree.expression) with_loc
val echar : (char -> Parsetree.expression) with_loc
val estring : (string -> Parsetree.expression) with_loc
val efloat : (string -> Parsetree.expression) with_loc
val eint32 : (int32 -> Parsetree.expression) with_loc
val eint64 : (int64 -> Parsetree.expression) with_loc
val enativeint : (nativeint -> Parsetree.expression) with_loc
val ebool : (bool -> Parsetree.expression) with_loc
val pint : (int -> Parsetree.pattern) with_loc
val pchar : (char -> Parsetree.pattern) with_loc
val pstring : (string -> Parsetree.pattern) with_loc
val pfloat : (string -> Parsetree.pattern) with_loc
val pint32 : (int32 -> Parsetree.pattern) with_loc
val pint64 : (int64 -> Parsetree.pattern) with_loc
val pnativeint : (nativeint -> Parsetree.pattern) with_loc
val pbool : (bool -> Parsetree.pattern) with_loc
val eunit : Parsetree.expression with_loc
val punit : Parsetree.pattern with_loc
val evar : (string -> Parsetree.expression) with_loc

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 : (string -> Parsetree.pattern) with_loc
val eapply : (Parsetree.expression -> Parsetree.expression list -> Parsetree.expression) with_loc

Same as pexp_apply but without labels

val eabstract : (Parsetree.pattern list -> Parsetree.expression -> Parsetree.expression) with_loc
val pconstruct : Parsetree.constructor_declaration -> Parsetree.pattern option -> Parsetree.pattern
val econstruct : Parsetree.constructor_declaration -> Parsetree.expression option -> Parsetree.expression
val elist : (Parsetree.expression list -> Parsetree.expression) with_loc
val plist : (Parsetree.pattern list -> Parsetree.pattern) with_loc
val nonrec_type_declaration : (name:string Location.loc -> params:(Parsetree.core_type * Asttypes.variance) list -> cstrs:(Parsetree.core_type * Parsetree.core_type * Location.t) list -> kind:Parsetree.type_kind -> private_:Asttypes.private_flag -> manifest:Parsetree.core_type option -> Parsetree.type_declaration) with_loc