module BatStd:sig..end
val print_bool : bool -> unitval prerr_bool : bool -> unitval input_file : ?bin:bool -> string -> stringval output_file : filename:string -> text:string -> unitval string_of_char : char -> stringval identity : 'a -> 'aval unique : unit -> intval dump : 'a -> stringval print : 'a -> unitdump.val finally : (unit -> unit) -> ('a -> 'b) -> 'a -> 'bfinally fend f x calls f x and then fend() even if f x raised
an exception.val args : unit -> string BatEnum.t
args () is given by the elements of Sys.argv, minus the first element.
val exe : string
exe is given by the first argument of Sys.argv
val (|>) : 'a -> ('a -> 'b) -> 'b
Function application. x |> f is equivalent to f x.
This operator is commonly used to write a function composition
by order of evaluation means rather than by inverse order.
For instance, g (f x) means "apply f to x, then apply
g to the result." In some circumstances, it may be more
understandable to write this as x |> f |> g, or
"starting from x, apply f, then apply g."
This operator may also be useful for composing sequences of
function calls without too many parenthesis.
val (<|) : ('a -> 'b) -> 'a -> 'bf <| x is equivalent to f x.
This operators may be useful for composing sequences of
function calls without too many parenthesis.
val (|-) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'cf |- g is fun x -> g (f x).
This is also equivalent to applying |> twice.val (-|) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'bf -| g is fun x -> f (g x). Mathematically, this is
operator o.val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
flip f x y is f y x. Don't abuse this function, it may shorten considerably
your code but it also has the nasty habit of making it harder to read.
val ( *** ) : ('a -> 'b) -> ('c -> 'd) -> 'a * 'c -> 'b * 'd
f *** g is fun (x,y) -> (f x, g y).
val (&&&) : ('a -> 'b) -> ('a -> 'c) -> 'a -> 'b * 'c
f &&& g is fun x -> (f x, g x).
val first : ('a -> 'b * 'c) -> 'a -> 'bval second : ('a -> 'b * 'c) -> 'a -> 'cval curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'cval uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'cval const : 'a -> 'b -> 'a
Therefore, const x is the function which always returns x.
type ('a, 'b) result =
| |
Ok of |
|||
| |
Bad of |
(* | The result of a computation - either an Ok with the normal
result or a Bad with some value (often an exception) containing
failure information | *) |
val ignore_ok : ('a, exn) result -> unitignore_ok (f x) ignores the result of f x if it's ok, but
throws the exception contained if Bad is returned.val ok : ('a, exn) result -> 'af x |> ok unwraps the Ok result of f x and returns it, or
throws the exception contained if Bad is returned.val wrap : ('a -> 'b) -> 'a -> ('b, exn) resultwrap f x wraps a function that would normally throw an exception
on failure such that it now returns a result with either the Ok
return value or the Bad exception.