Quick StartTryGuideAPICommunityBlogGitHub

Standard Library

Below is the API for the OCaml standard library. It's directly copied over from the OCaml Manual, formatted to the Reason syntax and styled accordingly. The API docs are work-in-progress; we'll be polishing these gradually!

If you're targeting JavaScript, the API docs for BuckleScript includes all of below, plus JS-specific APIs.

Module Ast_helper.Pat

module Pat: sig .. end
Patterns

val mk : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Parsetree.pattern_desc -> Parsetree.pattern
val attr : Parsetree.pattern -> Parsetree.attribute -> Parsetree.pattern
val any : ?loc:Ast_helper.loc -> ?attrs:Ast_helper.attrs -> unit -> Parsetree.pattern
val var : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Ast_helper.str -> Parsetree.pattern
val alias : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs ->       Parsetree.pattern -> Ast_helper.str -> Parsetree.pattern
val constant : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Asttypes.constant -> Parsetree.pattern
val interval : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs ->       Asttypes.constant -> Asttypes.constant -> Parsetree.pattern
val tuple : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Parsetree.pattern list -> Parsetree.pattern
val construct : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs ->       Ast_helper.lid -> Parsetree.pattern option -> Parsetree.pattern
val variant : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs ->       Asttypes.label -> Parsetree.pattern option -> Parsetree.pattern
val record : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs ->       (Ast_helper.lid * Parsetree.pattern) list ->       Asttypes.closed_flag -> Parsetree.pattern
val array : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Parsetree.pattern list -> Parsetree.pattern
val or_ : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs ->       Parsetree.pattern -> Parsetree.pattern -> Parsetree.pattern
val constraint_ : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs ->       Parsetree.pattern -> Parsetree.core_type -> Parsetree.pattern
val type_ : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Ast_helper.lid -> Parsetree.pattern
val lazy_ : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Parsetree.pattern -> Parsetree.pattern
val unpack : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Ast_helper.str -> Parsetree.pattern
val exception_ : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Parsetree.pattern -> Parsetree.pattern
val extension : ?loc:Ast_helper.loc ->       ?attrs:Ast_helper.attrs -> Parsetree.extension -> Parsetree.pattern