diff --git a/2.0/containers/CCArray/index.html b/2.0/containers/CCArray/index.html index c156b693..761208dc 100644 --- a/2.0/containers/CCArray/index.html +++ b/2.0/containers/CCArray/index.html @@ -1,5 +1,7 @@ -
include module type of Arrayval empty : 'a tval get : 'a t ‑> int ‑> 'aget a n returns the element number n of array a.
+
include module type of ArrayHoist an equality test for elements to arrays. +Arrays are only equal if their lengths are the same and +corresponding elements test equal.
val get : 'a t ‑> int ‑> 'aget a n returns the element number n of array a.
The first element has number 0.
The last element has number length a - 1.
You can also write a.(n) instead of get a n.
Raise Invalid_argument "index out of bounds"
@@ -12,9 +14,8 @@ indicated by the accumulator.
val iter : ('a ‑> unit) ‑> 'a t ‑> unititer f a applies function f in turn to all
the elements of a. It is equivalent to
-f a.(0); f a.(1); ...; f a.(length a - 1); ().
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitSame as Array.iter, but the -function is applied with the index of the element as first argument, -and the element itself as second argument.
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitLike Array.iter, but the function is applied to the index of the +element as first argument, and the element itself as second argument.
blit v1 o1 v2 o2 len copies len elements
from array v1, starting at element number o1, to array v2,
starting at element number o2. It works correctly even if
v1 and v2 are the same array, and the source and
@@ -32,19 +33,19 @@ that f x = Some y, else it returns
and p x holds. Otherwise returns None.
Lookup the index of some value in a sorted array.
Undefined behavior if the array is not sorted wrt cmp.
Complexity: O(log (n)) (dichotomic search).
None if the key is not present, or
-Some i (i the index of the key) otherwise.Same as lookup, but
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ?cmp x arr finds the index of the object x in the array arr,
+Some i (i the index of the key) otherwise.
Like lookup, but
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ?cmp x arr finds the index of the object x in the array arr,
provided arr is sorted using cmp. If the array is not sorted,
-the result is not specified (may raise Invalid_argument).
Complexity: O(log n) where n is the length of the array
-(dichotomic search).
Returns
`At i if cmp arr.(i) x = 0 (for some i)`All_lower if all elements of arr are lower than x`All_bigger if all elements of arr are bigger than x`Just_after i if arr.(i) < x < arr.(i+1)`Empty if the array is empty.cmp.val for_all : ('a ‑> bool) ‑> 'a t ‑> boolfor_all p [|a1; ...; an|] checks if all elements of the array
+the result is not specified (may
Raises Invalid_argument: ).
Complexity: O(log n) where n is the length of the array
+(dichotomic search).
Returns
`At i if cmp arr.(i) x = 0 (for some i).`All_lower if all elements of arr are lower than x.`All_bigger if all elements of arr are bigger than x.`Just_after i if arr.(i) < x < arr.(i+1).`Empty if the array is empty.cmp.val for_all : ('a ‑> bool) ‑> 'a t ‑> boolfor_all p [|a1; ...; an|] checks if all elements of the array
satisfy the predicate p. That is, it returns
-(p a1) && (p a2) && ... && (p an).
Forall on pairs of arrays.
val exists : ('a ‑> bool) ‑> 'a t ‑> boolexists p [|a1; ...; an|] checks if at least one element of
+(p a1) && (p a2) && ... && (p an).
Forall on pairs of arrays.
val exists : ('a ‑> bool) ‑> 'a t ‑> boolexists p [|a1; ...; an|] checks if at least one element of
the array satisfies the predicate p. That is, it returns
-(p a1) || (p a2) || ... || (p an).
Exists on pairs of arrays.
val random_choose : 'a t ‑> 'a random_genChoose an element randomly.
Exists on pairs of arrays.
val random_choose : 'a t ‑> 'a random_genChoose an element randomly.
map f a applies function f to all the elements of a,
and builds an array with the results returned by f:
[| f a.(0); f a.(1); ...; f a.(length a - 1) |].
map2 f a b applies function f to all the elements of a and b,
and builds an array with the results returned by f:
[| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|].
val except_idx : 'a t ‑> int ‑> 'a listRemove given index, obtaining the list of the other elements.
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genmodule type MONO_ARRAY : sig ... endval sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unitSort the array, without allocating (eats stack space though). Performance +the given predicate will be kept.
val except_idx : 'a t ‑> int ‑> 'a listRemove given index, obtaining the list of the other elements.
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genmodule type MONO_ARRAY : sig ... endval sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unitSort the array, without allocating (eats stack space though). Performance might be lower than Array.sort.
val empty : 'a tval get : 'a t ‑> int ‑> 'aget a n returns the element number n of array a.
+
Hoist an equality test for elements to arrays. +Arrays are only equal if their lengths are the same and +corresponding elements test equal.
val get : 'a t ‑> int ‑> 'aget a n returns the element number n of array a.
The first element has number 0.
The last element has number length a - 1.
You can also write a.(n) instead of get a n.
Raise Invalid_argument "index out of bounds"
@@ -10,9 +12,8 @@ if n is outside the range 0 to leng
where n is the length of the array a.
val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'aFold left on array until a stop condition via ('a, `Stop) is
indicated by the accumulator.
val iter : f:('a ‑> unit) ‑> 'a t ‑> unititer f a applies function f in turn to all
the elements of a. It is equivalent to
-f a.(0); f a.(1); ...; f a.(length a - 1); ().
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unitSame as Array.iter, but the -function is applied with the index of the element as first argument, -and the element itself as second argument.
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unitLike Array.iter, but the function is applied to the index of the +element as first argument, and the element itself as second argument.
blit v1 o1 v2 o2 len copies len elements
from array v1, starting at element number o1, to array v2,
starting at element number o2. It works correctly even if
v1 and v2 are the same array, and the source and
@@ -30,19 +31,19 @@ that f x = Some y, else it returns
and p x holds. Otherwise returns None.
Lookup the index of some value in a sorted array.
Undefined behavior if the array is not sorted wrt cmp.
Complexity: O(log (n)) (dichotomic search).
None if the key is not present, or
-Some i (i the index of the key) otherwise.Same as lookup, but
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> key:'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ?cmp key arr finds the index of the object key in the array arr,
+Some i (i the index of the key) otherwise.
Like lookup, but
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> key:'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ?cmp key arr finds the index of the object key in the array arr,
provided arr is sorted using cmp. If the array is not sorted,
the result is not specified (may raise Invalid_argument).
Complexity: O(log n) where n is the length of the array
-(dichotomic search).
Returns
`At i if cmp arr.(i) key = 0 (for some i)`All_lower if all elements of arr are lower than key`All_bigger if all elements of arr are bigger than key`Just_after i if arr.(i) < key < arr.(i+1)`Empty if the array is empty.cmp.val for_all : f:('a ‑> bool) ‑> 'a t ‑> boolfor_all p [|a1; ...; an|] checks if all elements of the array
+(dichotomic search).
Returns
`At i if cmp arr.(i) key = 0 (for some i).`All_lower if all elements of arr are lower than key.`All_bigger if all elements of arr are bigger than key.`Just_after i if arr.(i) < key < arr.(i+1).`Empty if the array is empty.cmp.val for_all : f:('a ‑> bool) ‑> 'a t ‑> boolfor_all p [|a1; ...; an|] checks if all elements of the array
satisfy the predicate p. That is, it returns
-(p a1) && (p a2) && ... && (p an).
Forall on pairs of arrays.
val exists : f:('a ‑> bool) ‑> 'a t ‑> boolexists p [|a1; ...; an|] checks if at least one element of
+(p a1) && (p a2) && ... && (p an).
Forall on pairs of arrays.
val exists : f:('a ‑> bool) ‑> 'a t ‑> boolexists p [|a1; ...; an|] checks if at least one element of
the array satisfies the predicate p. That is, it returns
-(p a1) || (p a2) || ... || (p an).
Exists on pairs of arrays.
val random_choose : 'a t ‑> 'a random_genChoose an element randomly.
Exists on pairs of arrays.
val random_choose : 'a t ‑> 'a random_genChoose an element randomly.
map f a applies function f to all the elements of a,
and builds an array with the results returned by f:
[| f a.(0); f a.(1); ...; f a.(length a - 1) |].
map2 f a b applies function f to all the elements of a and b,
and builds an array with the results returned by f:
[| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|].
val except_idx : 'a t ‑> int ‑> 'a listRemove given index, obtaining the list of the other elements.
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genmodule type MONO_ARRAY : sig ... endval sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unitSort the array, without allocating (eats stack space though). Performance +the given predicate will be kept.
val except_idx : 'a t ‑> int ‑> 'a listRemove given index, obtaining the list of the other elements.
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genmodule type MONO_ARRAY : sig ... endval sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unitSort the array, without allocating (eats stack space though). Performance might be lower than Array.sort.
val empty : 'a tval get : 'a t ‑> int ‑> 'aget a n returns the element number n of array a.
+
val get : 'a t ‑> int ‑> 'aget a n returns the element number n of array a.
The first element has number 0.
The last element has number length a - 1.
You can also write a.(n) instead of get a n.
Raise Invalid_argument "index out of bounds"
@@ -12,7 +12,7 @@ if n is outside the range 0 to leng
where n is the length of the array a.
val fold_while : ('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> 'a ‑> 'b t ‑> 'aFold left on array until a stop condition via ('a, `Stop) is
indicated by the accumulator.
val iter : ('a ‑> unit) ‑> 'a t ‑> unititer f a applies function f in turn to all
the elements of a. It is equivalent to
-f a.(0); f a.(1); ...; f a.(length a - 1); ().
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitSame as Array.iter, but the
+f a.(0); f a.(1); ...; f a.(length a - 1); ().
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitLike Array.iter, but the function is applied with the index of the element as first argument, and the element itself as second argument.
blit v1 o1 v2 o2 len copies len elements
from array v1, starting at element number o1, to array v2,
@@ -30,13 +30,13 @@ in sorted cmp a. a is not mo
lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val find : ('a ‑> 'b option) ‑> 'a t ‑> 'b optionfind f a returns Some y if there is an element x such
that f x = Some y, else it returns None.
val findi : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b optionLike find, but also pass the index to the predicate function.
val find_idx : ('a ‑> bool) ‑> 'a t ‑> (int * 'a) optionfind_idx p x returns Some (i,x) where x is the i-th element of l,
and p x holds. Otherwise returns None.
Lookup the index of some value in a sorted array.
None if the key is not present, or
-Some i (i the index of the key) otherwise.Same as lookup, but
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ?cmp x arr finds the index of the object x in the array arr,
+Some i (i the index of the key) otherwise.
Like lookup, but
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ?cmp x arr finds the index of the object x in the array arr,
provided arr is sorted using cmp. If the array is not sorted,
-the result is not specified (may raise Invalid_argument).
Complexity: O(log n) where n is the length of the array -(dichotomic search).
Returns
`At i if cmp arr.(i) x = 0 (for some i)`All_lower if all elements of arr are lower than x`All_bigger if all elements of arr are bigger than x`Just_after i if arr.(i) < x < arr.(i+1)`Empty if the array is emptycmpval for_all : ('a ‑> bool) ‑> 'a t ‑> boolfor_all p [|a1; ...; an|] checks if all elements of the array
+the result is not specified (may raise Invalid_argument).
Complexity: O(log n) where n is the length of the array
+(dichotomic search).
Returns
`At i if cmp arr.(i) x = 0 (for some i).`All_lower if all elements of arr are lower than x.`All_bigger if all elements of arr are bigger than x.`Just_after i if arr.(i) < x < arr.(i+1).`Empty if the array is empty.cmp.val for_all : ('a ‑> bool) ‑> 'a t ‑> boolfor_all p [|a1; ...; an|] checks if all elements of the array
satisfy the predicate p. That is, it returns
-(p a1) && (p a2) && ... && (p an).
Forall on pairs of arrays.
val exists : ('a ‑> bool) ‑> 'a t ‑> boolexists p [|a1; ...; an|] checks if at least one element of
+(p a1) && (p a2) && ... && (p an).
Forall on pairs of arrays.
val exists : ('a ‑> bool) ‑> 'a t ‑> boolexists p [|a1; ...; an|] checks if at least one element of
the array satisfies the predicate p. That is, it returns
-(p a1) || (p a2) || ... || (p an).
Exists on pairs of arrays.
val random_choose : 'a t ‑> 'a random_genChoose an element randomly.
(p a1) || (p a2) || ... || (p an).Exists on pairs of arrays.
val random_choose : 'a t ‑> 'a random_genChoose an element randomly.
Char to be passed as argument to the
using the US-ASCII character set.Convert the given character to its equivalent uppercase character, using the US-ASCII character set.
val of_int_exn : int ‑> tAlias to Char.chr. Return the character with the given ASCII code.
0,...,255.val pp : Buffer.t ‑> t ‑> unitval print : Format.formatter ‑> t ‑> unitval int : int tval string : string tval bool : bool tval float : float tval unit : unit tmap f eq is the equality function that, given objects x and y,
+
val int : int tval string : string tval bool : bool tval float : float tval unit : unit tmap f eq is the equality function that, given objects x and y,
projects x and y using f (e.g. using a record field) and then
compares those projections with eq.
Example:
map fst int compares values of type (int * 'a) by their
-first component.
module Infix : sig ... endmodule Infix : sig ... endval nan : tval max_value : tval min_value : tval max_finite_value : tval epsilon : tval is_nan : t ‑> boolval hash : t ‑> intval random : t ‑> t random_genval random_small : t random_genval random_range : t ‑> t ‑> t random_genval sign_exn : t ‑> intsign_exn x will return the sign of x as 1, 0 or -1, or raise an
-exception TrapNaN if x is a NaN.
+
val epsilon : tThe smallest positive float x such that 1.0 +. x <> 1.0.
+Equal to Pervasives.epsilon_float.
val hash : t ‑> intval random : t ‑> t random_genval random_small : t random_genval random_range : t ‑> t ‑> t random_genval sign_exn : t ‑> intsign_exn x will return the sign of x as 1, 0 or -1, or raise an
+exception TrapNaN if x is NaN.
Note that infinities have defined signs in OCaml.
val to_string : t ‑> stringval of_string : string ‑> tAlias to float_of_string.
val to_string : t ‑> stringval of_string_exn : string ‑> tAlias to float_of_string.
val of_string : string ‑> tAlias to float_of_string.
Return the class of the given floating-point number: +normal, subnormal, zero, infinite or nan (not a number).
module Infix : sig ... endval unit : unit tval int : int tval string : string tval bool : bool tval float : float tval char : char tval int32 : int32 tval int64 : int64 tval nativeint : nativeint tval unit : unit tval int : int tval string : string tval bool : bool tval float : float tval char : char tval int32 : int32 tval int64 : int64 tval nativeint : nativeint tinclude module type of sig ... endval open_tag : tag ‑> unitval set_formatter_out_functions : formatter_out_functions ‑> unitval get_formatter_out_functions : unit ‑> formatter_out_functionsval set_formatter_tag_functions : formatter_tag_functions ‑> unitval get_formatter_tag_functions : unit ‑> formatter_tag_functionsval formatter_of_out_channel : Pervasives.out_channel ‑> formatterval std_formatter : formatterval err_formatter : formatterval formatter_of_buffer : Buffer.t ‑> formatterval str_formatter : formatterval make_formatter : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> formatterval pp_open_hbox : formatter ‑> unit ‑> unitval pp_open_vbox : formatter ‑> int ‑> unitval pp_open_hvbox : formatter ‑> int ‑> unitval pp_open_hovbox : formatter ‑> int ‑> unitval pp_open_box : formatter ‑> int ‑> unitval pp_close_box : formatter ‑> unit ‑> unitval pp_open_tag : formatter ‑> string ‑> unitval pp_close_tag : formatter ‑> unit ‑> unitval pp_print_string : formatter ‑> string ‑> unitval pp_print_as : formatter ‑> int ‑> string ‑> unitval pp_print_int : formatter ‑> int ‑> unitval pp_print_float : formatter ‑> float ‑> unitval pp_print_char : formatter ‑> char ‑> unitval pp_print_bool : formatter ‑> bool ‑> unitval pp_print_break : formatter ‑> int ‑> int ‑> unitval pp_print_cut : formatter ‑> unit ‑> unitval pp_print_space : formatter ‑> unit ‑> unitval pp_force_newline : formatter ‑> unit ‑> unitval pp_print_flush : formatter ‑> unit ‑> unitval pp_print_newline : formatter ‑> unit ‑> unitval pp_print_if_newline : formatter ‑> unit ‑> unitval pp_set_tags : formatter ‑> bool ‑> unitval pp_set_print_tags : formatter ‑> bool ‑> unitval pp_set_mark_tags : formatter ‑> bool ‑> unitval pp_get_print_tags : formatter ‑> unit ‑> boolval pp_get_mark_tags : formatter ‑> unit ‑> boolval pp_set_margin : formatter ‑> int ‑> unitval pp_get_margin : formatter ‑> unit ‑> intval pp_set_max_indent : formatter ‑> int ‑> unitval pp_get_max_indent : formatter ‑> unit ‑> intval pp_set_max_boxes : formatter ‑> int ‑> unitval pp_get_max_boxes : formatter ‑> unit ‑> intval pp_over_max_boxes : formatter ‑> unit ‑> boolval pp_set_ellipsis_text : formatter ‑> string ‑> unitval pp_get_ellipsis_text : formatter ‑> unit ‑> stringval pp_set_formatter_out_channel : formatter ‑> Pervasives.out_channel ‑> unitval pp_set_formatter_output_functions : formatter ‑> (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unitval pp_get_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)val pp_set_formatter_tag_functions : formatter ‑> formatter_tag_functions ‑> unitval pp_get_formatter_tag_functions : formatter ‑> unit ‑> formatter_tag_functionsval pp_set_formatter_out_functions : formatter ‑> formatter_out_functions ‑> unitval pp_get_formatter_out_functions : formatter ‑> unit ‑> formatter_out_functionsval pp_flush_formatter : formatter ‑> unitval pp_print_text : formatter ‑> string ‑> unitval printf : ('a, formatter, unit) Pervasives.format ‑> 'aval eprintf : ('a, formatter, unit) Pervasives.format ‑> 'aval asprintf : ('a, formatter, unit, string) Pervasives.format4 ‑> 'aval kasprintf : (string ‑> 'a) ‑> ('b, formatter, unit, 'a) Pervasives.format4 ‑> 'bval bprintf : Buffer.t ‑> ('a, formatter, unit) Pervasives.format ‑> 'aval kprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'bval set_all_formatter_output_functions : out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unitval get_all_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)val pp_set_all_formatter_output_functions : formatter ‑> out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unitval pp_get_all_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)val pp_close_tbox : formatter ‑> unit ‑> unitval pp_print_tbreak : formatter ‑> int ‑> int ‑> unitval int : int printerval string : string printerval bool : bool printerval float3 : float printerval float : float printerval substring : (string * int * int) printerPrint the substring (s,i,len), where i is the offset
+
include module type of sig ... endval open_tag : tag ‑> unitval set_formatter_out_functions : formatter_out_functions ‑> unitval get_formatter_out_functions : unit ‑> formatter_out_functionsval set_formatter_tag_functions : formatter_tag_functions ‑> unitval get_formatter_tag_functions : unit ‑> formatter_tag_functionsval formatter_of_out_channel : Pervasives.out_channel ‑> formatterval std_formatter : formatterval err_formatter : formatterval formatter_of_buffer : Buffer.t ‑> formatterval str_formatter : formatterval make_formatter : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> formatterval pp_open_hbox : formatter ‑> unit ‑> unitval pp_open_vbox : formatter ‑> int ‑> unitval pp_open_hvbox : formatter ‑> int ‑> unitval pp_open_hovbox : formatter ‑> int ‑> unitval pp_open_box : formatter ‑> int ‑> unitval pp_close_box : formatter ‑> unit ‑> unitval pp_open_tag : formatter ‑> string ‑> unitval pp_close_tag : formatter ‑> unit ‑> unitval pp_print_string : formatter ‑> string ‑> unitval pp_print_as : formatter ‑> int ‑> string ‑> unitval pp_print_int : formatter ‑> int ‑> unitval pp_print_float : formatter ‑> float ‑> unitval pp_print_char : formatter ‑> char ‑> unitval pp_print_bool : formatter ‑> bool ‑> unitval pp_print_break : formatter ‑> int ‑> int ‑> unitval pp_print_cut : formatter ‑> unit ‑> unitval pp_print_space : formatter ‑> unit ‑> unitval pp_force_newline : formatter ‑> unit ‑> unitval pp_print_flush : formatter ‑> unit ‑> unitval pp_print_newline : formatter ‑> unit ‑> unitval pp_print_if_newline : formatter ‑> unit ‑> unitval pp_set_tags : formatter ‑> bool ‑> unitval pp_set_print_tags : formatter ‑> bool ‑> unitval pp_set_mark_tags : formatter ‑> bool ‑> unitval pp_get_print_tags : formatter ‑> unit ‑> boolval pp_get_mark_tags : formatter ‑> unit ‑> boolval pp_set_margin : formatter ‑> int ‑> unitval pp_get_margin : formatter ‑> unit ‑> intval pp_set_max_indent : formatter ‑> int ‑> unitval pp_get_max_indent : formatter ‑> unit ‑> intval pp_set_max_boxes : formatter ‑> int ‑> unitval pp_get_max_boxes : formatter ‑> unit ‑> intval pp_over_max_boxes : formatter ‑> unit ‑> boolval pp_set_ellipsis_text : formatter ‑> string ‑> unitval pp_get_ellipsis_text : formatter ‑> unit ‑> stringval pp_set_formatter_out_channel : formatter ‑> Pervasives.out_channel ‑> unitval pp_set_formatter_output_functions : formatter ‑> (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unitval pp_get_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)val pp_set_formatter_tag_functions : formatter ‑> formatter_tag_functions ‑> unitval pp_get_formatter_tag_functions : formatter ‑> unit ‑> formatter_tag_functionsval pp_set_formatter_out_functions : formatter ‑> formatter_out_functions ‑> unitval pp_get_formatter_out_functions : formatter ‑> unit ‑> formatter_out_functionsval pp_flush_formatter : formatter ‑> unitval pp_print_text : formatter ‑> string ‑> unitval printf : ('a, formatter, unit) Pervasives.format ‑> 'aval eprintf : ('a, formatter, unit) Pervasives.format ‑> 'aval asprintf : ('a, formatter, unit, string) Pervasives.format4 ‑> 'aval kasprintf : (string ‑> 'a) ‑> ('b, formatter, unit, 'a) Pervasives.format4 ‑> 'bval bprintf : Buffer.t ‑> ('a, formatter, unit) Pervasives.format ‑> 'aval kprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'bval set_all_formatter_output_functions : out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unitval get_all_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)val pp_set_all_formatter_output_functions : formatter ‑> out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unitval pp_get_all_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)val pp_close_tbox : formatter ‑> unit ‑> unitval pp_print_tbreak : formatter ‑> int ‑> int ‑> unitval int : int printerval string : string printerval bool : bool printerval float3 : float printerval float : float printerval substring : (string * int * int) printerPrint the substring (s,i,len), where i is the offset
in s and len the number of bytes in the substring.
(s,i,len) does not
describe a proper substring.val text : string printerPrint string, but replacing spaces with breaks and newlines
with newline.
See pp_print_text on recent versions of OCaml.
opt pp prints options as follows:
-Some x will become "some foo" if pp x ---> "foo"None will become "none"
In the tuple printers, the sep argument is only available
within a b p wraps p inside the strings a and b. Convenient,
-for instances, for brackets, parenthesis, quotes, etc.
Wrap the printer in a vertical box
Wrap the printer in a horizontal/vertical box
Wrap the printer in a horizontal or vertical box
val return : ('a, _, _, 'a) Pervasives.format4 ‑> unit printerreturn "some_format_string" takes a argument-less format string
+Some x will become "some foo" if pp x ---> "foo".
+None will become "none".
In the tuple printers, the sep argument is only available.
within a b p wraps p inside the strings a and b. Convenient,
+for instances, for brackets, parenthesis, quotes, etc.
Wrap the printer in a vertical box.
Wrap the printer in a horizontal/vertical box.
Wrap the printer in a horizontal or vertical box.
val return : ('a, _, _, 'a) Pervasives.format4 ‑> unit printerreturn "some_format_string" takes a argument-less format string
and returns a printer actionable by ().
Examples:
return ",@ "return "@{<Red>and then@}@,"return "@[<v>a@ b@]"val of_to_string : ('a ‑> string) ‑> 'a printerof_to_string f converts its input to a string using f,
-then prints the string
some pp will print options as follows:
-
Some x is printed using pp on xNone is not printed at allUse ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code +then prints the string.
some pp will print options as follows:
+
Some x is printed using pp on x.None is not printed at all.Use ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code to put some colors on the terminal.
This uses tags in format strings to specify the style. Current styles are the following:
Example:
set_color_default true;;
Format.printf
- "what is your @{<White>favorite color@}? @{<blue>blue@}! No, @{<red>red@}! Ahhhhhhh@.";;status: unstable
val set_color_tag_handling : t ‑> unitadds functions to support color tags to the given formatter.
val set_color_default : bool ‑> unitset_color_default b enables color handling on the standard formatters
+ "what is your @{<White>favorite color@}? @{<blue>blue@}! No, @{<red>red@}! Ahhhhhhh@.";;
status: unstable
val set_color_tag_handling : t ‑> unitAdd functions to support color tags to the given formatter.
val set_color_default : bool ‑> unitset_color_default b enables color handling on the standard formatters
(stdout, stderr) if b = true as well as on sprintf formatters;
it disables the color handling if b = false.
with_color "Blue" pp behaves like the printer pp, but with the given
style.
status: unstable
with_colorf "Blue" out "%s %d" "yolo" 42 will behave like Format.fprintf,
-but wrapping the content with the given style
+but wrapping the content with the given style.
status: unstable
val with_color_sf : string ‑> ('a, t, unit, string) Pervasives.format4 ‑> 'aval with_color_ksf : f:(string ‑> 'b) ‑> string ‑> ('a, t, unit, 'b) Pervasives.format4 ‑> 'awith_color_ksf "Blue" ~f "%s %d" "yolo" 42 will behave like
-ksprintf, but wrapping the content with the given style
+ksprintf, but wrapping the content with the given style.
Example:
the following with raise Failure with a colored message
-
CCFormat.with_color_ksf "red" ~f:failwith "%a" CCFormat.Dump.(list int) [1;2;3];;val to_string : 'a printer ‑> 'a ‑> stringval with_out_chan : Pervasives.out_channel ‑> (t ‑> 'a) ‑> 'awith_out_chan oc f turns oc into a formatter fmt, and call f fmt.
+
CCFormat.with_color_ksf "red" ~f:failwith "%a" CCFormat.Dump.(list int) [1;2;3];;val to_string : 'a printer ‑> 'a ‑> stringval with_out_chan : Pervasives.out_channel ‑> (t ‑> 'a) ‑> 'awith_out_chan oc f turns oc into a formatter fmt, and call f fmt.
Behaves like f fmt from then on, but whether the call to f fails
or returns, fmt is flushed before the call terminates.
val stdout : tval stderr : tval sprintf : ('a, t, unit, string) Pervasives.format4 ‑> 'aPrint into a string any format string that would usually be compatible -with fprintf. Similar to Format.asprintf.
val sprintf_no_color : ('a, t, unit, string) Pervasives.format4 ‑> 'aSimilar to sprintf but never prints colors
val sprintf_dyn_color : colors:bool ‑> ('a, t, unit, string) Pervasives.format4 ‑> 'aval sprintf_no_color : ('a, t, unit, string) Pervasives.format4 ‑> 'aSimilar to sprintf but never prints colors.
val sprintf_dyn_color : colors:bool ‑> ('a, t, unit, string) Pervasives.format4 ‑> 'aSimilar to sprintf but enable/disable colors depending on colors.
Example:
(* with colors *)
CCFormat.sprintf_dyn_color ~colors:true "@{<Red>%a@}"
@@ -39,8 +40,8 @@ Example:
(* without colors *)
CCFormat.sprintf_dyn_color ~colors:false "@{<Red>%a@}"
- CCFormat.Dump.(list int) [1;2;3] |> print_endline;;Similar to fprintf but enable/disable colors depending on colors
val ksprintf : f:(string ‑> 'b) ‑> ('a, Format.formatter, unit, 'b) Pervasives.format4 ‑> 'aksprintf fmt ~f formats using fmt, in a way similar to sprintf,
-and then calls f on the resulting string.
Print structures as OCaml values, so that they can be parsed back + CCFormat.Dump.(list int) [1;2;3] |> print_endline;;
Similar to fprintf but enable/disable colors depending on colors.
val ksprintf : f:(string ‑> 'b) ‑> ('a, Format.formatter, unit, 'b) Pervasives.format4 ‑> 'aksprintf fmt ~f formats using fmt, in a way similar to sprintf,
+and then calls f on the resulting string.
Print structures as OCaml values, so that they can be parsed back by OCaml (typically, in the toplevel, for debugging).
Example:
Format.printf "%a@." CCFormat.Dump.(list int) CCList.(1 -- 200);;
diff --git a/2.0/containers/CCFun/Monad/index.html b/2.0/containers/CCFun/Monad/index.html
index 28ec149e..67350d69 100644
--- a/2.0/containers/CCFun/Monad/index.html
+++ b/2.0/containers/CCFun/Monad/index.html
@@ -1,2 +1,2 @@
-Monad (containers.CCFun.Monad) Module CCFun.Monad
Parameters
X : sig ... endSignature
val return : 'a ‑> 'a t
\ No newline at end of file
+Monad (containers.CCFun.Monad) Module CCFun.Monad
Parameters
X : sig ... endSignature
\ No newline at end of file
diff --git a/2.0/containers/CCFun/index.html b/2.0/containers/CCFun/index.html
index 8c62a05f..7d3ef072 100644
--- a/2.0/containers/CCFun/index.html
+++ b/2.0/containers/CCFun/index.html
@@ -1,14 +1,17 @@
-CCFun (containers.CCFun) Module CCFun
Basic Functions
val compose_binop : ('a ‑> 'b) ‑> ('b ‑> 'b ‑> 'c) ‑> 'a ‑> 'a ‑> 'ccompose_binop f g is fun x y -> g (f x) (f y)
+
CCFun (containers.CCFun) Module CCFun
Basic Functions
val compose_binop : ('a ‑> 'b) ‑> ('b ‑> 'b ‑> 'c) ‑> 'a ‑> 'a ‑> 'ccompose_binop f g is fun x y -> g (f x) (f y).
Example (partial order):
-List.sort (compose_binop fst CCInt.compare) [1, true; 2, false; 1, false]
- Since: 0.6
val tap : ('a ‑> _) ‑> 'a ‑> 'atap f x evaluates f x, discards it, then returns x. Useful
+List.sort (compose_binop fst CCInt.compare) [1, true; 2, false; 1, false].
- Since: 0.6
val const : 'a ‑> 'b ‑> 'aProduce a function that just returns its first argument.
+const x y = x for any y.
val curry : (('a * 'b) ‑> 'c) ‑> 'a ‑> 'b ‑> 'cConvert a function which accepts a pair of arguments into a function which accepts two arguments.
+curry f x y is f (x,y).
val uncurry : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'cConvert a function which accepts a two arguments into a function which accepts a pair of arguments.
+uncurry f (x,y) is f x y.
val tap : ('a ‑> _) ‑> 'a ‑> 'atap f x evaluates f x, discards it, then returns x. Useful
in a pipeline, for instance:
CCArray.(1 -- 10)
|> tap CCArray.shuffle
- |> tap @@ CCArray.sort Pervasives.compare
val lexicographic : ('a ‑> 'a ‑> int) ‑> ('a ‑> 'a ‑> int) ‑> 'a ‑> 'a ‑> intLexicographic combination of comparison functions
val finally : h:(unit ‑> _) ‑> f:(unit ‑> 'a) ‑> 'afinally h f calls f () and returns its result. If it raises, the
+ |> tap @@ CCArray.sort Pervasives.compare
val lexicographic : ('a ‑> 'a ‑> int) ‑> ('a ‑> 'a ‑> int) ‑> 'a ‑> 'a ‑> intLexicographic combination of comparison functions.
val finally : h:(unit ‑> _) ‑> f:(unit ‑> 'a) ‑> 'afinally h f calls f () and returns its result. If it raises, the
same exception is raised; in any case, h () is called after
f () terminates.
val finally1 : h:(unit ‑> _) ‑> ('a ‑> 'b) ‑> 'a ‑> 'bfinally1 ~h f x is the same as f x, but after the computation,
h () is called whether f x rose an exception or not.
- Since: 0.16
val finally2 : h:(unit ‑> _) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'cfinally2 ~h f x y is the same as f x y, but after the computation,
h () is called whether f x y rose an exception or not.
- Since: 0.16
val opaque_identity : 'a ‑> 'aopaque_identity x is like x, but prevents Flambda from using x's
-definition for optimizing it (flambda is an optimization/inlining pass
-in OCaml >= 4.03).
- Since: 0.18
Monad
Functions with a fixed domain are monads in their codomain
\ No newline at end of file
+definition for optimizing it. (flambda is an optimization/inlining pass
+in OCaml >= 4.03).- Since: 0.18
Monad
Functions with a fixed domain are monads in their codomain.
\ No newline at end of file
diff --git a/2.0/containers/CCHash/index.html b/2.0/containers/CCHash/index.html
index 5d973e96..f1655064 100644
--- a/2.0/containers/CCHash/index.html
+++ b/2.0/containers/CCHash/index.html
@@ -1,7 +1,8 @@
-CCHash (containers.CCHash) Module CCHash
Hash combinators
Definitions
val const0 : _ tAlways return 0. Useful for ignoring elements.
+
CCHash (containers.CCHash) Module CCHash
Hash combinators
Definitions
val const0 : _ tAlways return 0. Useful for ignoring elements.
Example: Hash.(pair string const0) will map pairs ("a", 1)
-and ("a", 2) to the same hash, but not the same as ("b", 1)
- Since: 1.5
val int : int tval bool : bool tval char : char tval int32 : int32 tval int64 : int64 tval nativeint : nativeint tval slice : string ‑> int ‑> int tslice s i len state hashes the slice i, ... i+len-1 of s
-into state
val string : string tCommutative version of list. Lists that are equal up to permutation
+and ("a", 2) to the same hash, but not the same as ("b", 1).
- Since: 1.5
val int : int tval bool : bool tval char : char tval int32 : int32 tval int64 : int64 tval nativeint : nativeint tval slice : string ‑> int ‑> int tslice s i len state hashes the slice i, ... i+len-1 of s
+into state.
val string : string tCommutative version of list. Lists that are equal up to permutation
will have the same hash.
- Since: 1.0
Commutative version of array. Arrays that are equal up to permutation
will have the same hash.
- Since: 1.0
Base hash combinators
Iterators
\ No newline at end of file
diff --git a/2.0/containers/CCHashtbl/Poly/index.html b/2.0/containers/CCHashtbl/Poly/index.html
index 422f6198..c1fce9a1 100644
--- a/2.0/containers/CCHashtbl/Poly/index.html
+++ b/2.0/containers/CCHashtbl/Poly/index.html
@@ -1,20 +1,20 @@
-Poly (containers.CCHashtbl.Poly) Module CCHashtbl.Poly
val get_or : ('a, 'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'bget_or tbl k ~default returns the value associated to k if present,
-and returns default otherwise (if k doesn't belong in tbl)
- Since: 0.16
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a, 'b) Hashtbl.t ‑> 'c listMap on a hashtable's items, collect into a list
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitincr ?by tbl x increments or initializes the counter associated with x.
+
Poly (containers.CCHashtbl.Poly) Module CCHashtbl.Poly
val get_or : ('a, 'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'bget_or tbl k ~default returns the value associated to k if present,
+and returns default otherwise (if k doesn't belong in tbl).
- Since: 0.16
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a, 'b) Hashtbl.t ‑> 'c listMap on a hashtable's items, collect into a list.
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitincr ?by tbl x increments or initializes the counter associated with x.
If get tbl x = None, then after update, get tbl x = Some 1;
-otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1 - Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitSame as incr but substract 1 (or the value of by).
+otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1. - Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitLike incr but subtract 1 (or the value of by).
If the value reaches 0, the key is removed from the table.
-This does nothing if the key is not already present in the table.
- Since: 0.16
val add_list : ('a, 'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unitadd_list tbl x y adds y to the list x is bound to. If x is
-not bound, it becomes bound to [y].
- Since: 0.16
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
+This does nothing if the key is not already present in the table.
- Since: 0.16
val add_list : ('a, 'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unitadd_list tbl x y adds y to the list x is bound to. If x is
+not bound, it becomes bound to y.
- Since: 0.16
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
by calling incr. This is useful for counting how many times each
-element of seq occurs.
- Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.tSimilar to add_seq_count, but allocates a new table and returns it
- Since: 0.16
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.tBuild a table from the given list of bindings k_i -> v_i,
+element of seq occurs.
- Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.tSimilar to add_seq_count, but allocates a new table and returns it.
- Since: 0.16
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.tBuild a table from the given list of bindings k_i -> v_i,
added in order using add. If a key occurs several times,
it will be added several times, and the visible binding
will be the last one.
val update : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unitupdate tbl ~f ~k updates key k by calling f k (Some v) if
k was mapped to v, or f k None otherwise; if the call
returns None then k is removed/stays removed, if the call
returns Some v' then the binding k -> v' is inserted
-using Hashtbl.replace
- Since: 0.14
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'bget_or_add tbl ~k ~f finds and returns the binding of k
+using Hashtbl.replace.
- Since: 0.14
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'bget_or_add tbl ~k ~f finds and returns the binding of k
in tbl, if it exists. If it does not exist, then f k
is called to obtain a new binding v; k -> v is added
to tbl and v is returned.
- Since: 1.0
\ No newline at end of file
diff --git a/2.0/containers/CCHashtbl/index.html b/2.0/containers/CCHashtbl/index.html
index 2657f658..5b202b9f 100644
--- a/2.0/containers/CCHashtbl/index.html
+++ b/2.0/containers/CCHashtbl/index.html
@@ -1,20 +1,20 @@
-CCHashtbl (containers.CCHashtbl) Module CCHashtbl
Extension to the standard Hashtbl
- Since: 0.4
Polymorphic tables
This sub-module contains the extension of the standard polymorphic hashtbl.
module Poly : sig ... endinclude module type of Poly
val get_or : ('a, 'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'bget_or tbl k ~default returns the value associated to k if present,
-and returns default otherwise (if k doesn't belong in tbl)
- Since: 0.16
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a, 'b) Hashtbl.t ‑> 'c listMap on a hashtable's items, collect into a list
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitincr ?by tbl x increments or initializes the counter associated with x.
+
CCHashtbl (containers.CCHashtbl) Module CCHashtbl
Extension to the standard Hashtbl
- Since: 0.4
Polymorphic tables
This sub-module contains the extension of the standard polymorphic Hashtbl.
module Poly : sig ... endinclude module type of Poly
val get_or : ('a, 'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'bget_or tbl k ~default returns the value associated to k if present,
+and returns default otherwise (if k doesn't belong in tbl).
- Since: 0.16
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a, 'b) Hashtbl.t ‑> 'c listMap on a hashtable's items, collect into a list.
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitincr ?by tbl x increments or initializes the counter associated with x.
If get tbl x = None, then after update, get tbl x = Some 1;
-otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1 - Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitSame as incr but substract 1 (or the value of by).
+otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1. - Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitLike incr but subtract 1 (or the value of by).
If the value reaches 0, the key is removed from the table.
-This does nothing if the key is not already present in the table.
- Since: 0.16
val add_list : ('a, 'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unitadd_list tbl x y adds y to the list x is bound to. If x is
-not bound, it becomes bound to [y].
- Since: 0.16
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
+This does nothing if the key is not already present in the table.
- Since: 0.16
val add_list : ('a, 'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unitadd_list tbl x y adds y to the list x is bound to. If x is
+not bound, it becomes bound to y.
- Since: 0.16
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
by calling incr. This is useful for counting how many times each
-element of seq occurs.
- Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.tSimilar to add_seq_count, but allocates a new table and returns it
- Since: 0.16
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.tBuild a table from the given list of bindings k_i -> v_i,
+element of seq occurs.
- Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.tSimilar to add_seq_count, but allocates a new table and returns it.
- Since: 0.16
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.tBuild a table from the given list of bindings k_i -> v_i,
added in order using add. If a key occurs several times,
it will be added several times, and the visible binding
will be the last one.
val update : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unitupdate tbl ~f ~k updates key k by calling f k (Some v) if
k was mapped to v, or f k None otherwise; if the call
returns None then k is removed/stays removed, if the call
returns Some v' then the binding k -> v' is inserted
-using Hashtbl.replace
- Since: 0.14
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'bget_or_add tbl ~k ~f finds and returns the binding of k
+using Hashtbl.replace.
- Since: 0.14
Functor
module type S : sig ... end
\ No newline at end of file
diff --git a/2.0/containers/CCHashtbl/module-type-S/index.html b/2.0/containers/CCHashtbl/module-type-S/index.html
index e9d85a5c..d5ee11c4 100644
--- a/2.0/containers/CCHashtbl/module-type-S/index.html
+++ b/2.0/containers/CCHashtbl/module-type-S/index.html
@@ -1,20 +1,20 @@
-S (containers.CCHashtbl.S) Module type CCHashtbl.S
get_or tbl k ~default returns the value associated to k if present,
-and returns default otherwise (if k doesn't belong in tbl)
- Since: 0.16
add_list tbl x y adds y to the list x is bound to. If x is
-not bound, it becomes bound to [y].
- Since: 0.16
incr ?by tbl x increments or initializes the counter associated with x.
+
S (containers.CCHashtbl.S) Module type CCHashtbl.S
get_or tbl k ~default returns the value associated to k if present,
+and returns default otherwise (if k doesn't belong in tbl).
- Since: 0.16
add_list tbl x y adds y to the list x is bound to. If x is
+not bound, it becomes bound to y.
- Since: 0.16
incr ?by tbl x increments or initializes the counter associated with x.
If get tbl x = None, then after update, get tbl x = Some 1;
-otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1 - Since: 0.16
Same as incr but substract 1 (or the value of by).
+otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1. - Since: 0.16
Like incr but subtract 1 (or the value of by).
If the value reaches 0, the key is removed from the table.
-This does nothing if the key is not already present in the table.
- Since: 0.16
add_seq_count tbl seq increments the count of each element of seq
+This does nothing if the key is not already present in the table.
- Since: 0.16
add_seq_count tbl seq increments the count of each element of seq
by calling incr. This is useful for counting how many times each
-element of seq occurs.
- Since: 0.16
Similar to add_seq_count, but allocates a new table and returns it
- Since: 0.16
Similar to add_seq_count, but allocates a new table and returns it.
- Since: 0.16
Build a table from the given list of bindings k_i -> v_i,
added in order using add. If a key occurs several times,
it will be added several times, and the visible binding
will be the last one.
update tbl ~f ~k updates key k by calling f k (Some v) if
k was mapped to v, or f k None otherwise; if the call
returns None then k is removed/stays removed, if the call
returns Some v' then the binding k -> v' is inserted
-using Hashtbl.replace
- Since: 0.14
get_or_add tbl ~k ~f finds and returns the binding of k
in tbl, if it exists. If it does not exist, then f k
is called to obtain a new binding v; k -> v is added
to tbl and v is returned.
- Since: 1.0
\ No newline at end of file
diff --git a/2.0/containers/CCHeap/Make/argument-1-E/index.html b/2.0/containers/CCHeap/Make/argument-1-E/index.html
index 74b4d3b2..6173385d 100644
--- a/2.0/containers/CCHeap/Make/argument-1-E/index.html
+++ b/2.0/containers/CCHeap/Make/argument-1-E/index.html
@@ -1,2 +1,2 @@
-1-E (containers.CCHeap.Make.1-E) Parameter CCHeap.Make.1-E
\ No newline at end of file
+1-E (containers.CCHeap.Make.1-E) Parameter CCHeap.Make.1-E
\ No newline at end of file
diff --git a/2.0/containers/CCHeap/Make/index.html b/2.0/containers/CCHeap/Make/index.html
index f81ee3e8..38b7cc68 100644
--- a/2.0/containers/CCHeap/Make/index.html
+++ b/2.0/containers/CCHeap/Make/index.html
@@ -1,5 +1,11 @@
-Make (containers.CCHeap.Make) Module CCHeap.Make
Parameters
E : PARTIAL_ORDSignature
Extract and return the minimum element, and the new heap (without
-this element), or None if the heap is empty
Add the elements of the list to the heap. An element occurring several
-times will be added that many times to the heap.
- Since: 0.16
\ No newline at end of file
+Make (containers.CCHeap.Make) Module CCHeap.Make
Parameters
E : PARTIAL_ORDSignature
Extract and return the minimum element, and the new heap (without
+this element), or None if the heap is empty.
Delete one occurrence of a value if it exist in the heap.
+delete_one eq x h, use eq to find one x in h and delete it.
+If h do not contain x then it return h.
- Since: 2.0
Delete all occurrences of a value in the heap.
+delete_all eq x h, use eq to find all x in h and delete them.
+If h do not contain x then it return h.
+The difference with filter is that delete_all stops as soon as
+it enters a subtree whose root is bigger than the element.
- Since: 2.0
Add the elements of the list to the heap. An element occurring several
+times will be added that many times to the heap.
- Since: 0.16
\ No newline at end of file
diff --git a/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html b/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html
index e8d53b86..b5e693f3 100644
--- a/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html
+++ b/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html
@@ -1,2 +1,2 @@
-PARTIAL_ORD (containers.CCHeap.PARTIAL_ORD) Module type CCHeap.PARTIAL_ORD
\ No newline at end of file
+PARTIAL_ORD (containers.CCHeap.PARTIAL_ORD) Module type CCHeap.PARTIAL_ORD
\ No newline at end of file
diff --git a/2.0/containers/CCHeap/module-type-S/index.html b/2.0/containers/CCHeap/module-type-S/index.html
index 3fd20559..4e53df7c 100644
--- a/2.0/containers/CCHeap/module-type-S/index.html
+++ b/2.0/containers/CCHeap/module-type-S/index.html
@@ -1,5 +1,11 @@
-S (containers.CCHeap.S) Module type CCHeap.S
Extract and return the minimum element, and the new heap (without
-this element), or None if the heap is empty
Add the elements of the list to the heap. An element occurring several
-times will be added that many times to the heap.
- Since: 0.16
\ No newline at end of file
+S (containers.CCHeap.S) Module type CCHeap.S
Extract and return the minimum element, and the new heap (without
+this element), or None if the heap is empty.
Delete one occurrence of a value if it exist in the heap.
+delete_one eq x h, use eq to find one x in h and delete it.
+If h do not contain x then it return h.
- Since: 2.0
Delete all occurrences of a value in the heap.
+delete_all eq x h, use eq to find all x in h and delete them.
+If h do not contain x then it return h.
+The difference with filter is that delete_all stops as soon as
+it enters a subtree whose root is bigger than the element.
- Since: 2.0
Add the elements of the list to the heap. An element occurring several
+times will be added that many times to the heap.
- Since: 0.16
\ No newline at end of file
diff --git a/2.0/containers/CCIO/File/index.html b/2.0/containers/CCIO/File/index.html
index b25929db..d45f88a5 100644
--- a/2.0/containers/CCIO/File/index.html
+++ b/2.0/containers/CCIO/File/index.html
@@ -1,14 +1,14 @@
File (containers.CCIO.File) Module CCIO.File
type t = stringA file should be represented by its absolute path, but currently
-this is not enforced.
val to_string : t ‑> stringval exists : t ‑> boolval is_directory : t ‑> boolval remove_exn : t ‑> unitremove_exn path tries to remove the file at path from the
+this is not enforced.
val to_string : t ‑> stringval exists : t ‑> boolval is_directory : t ‑> boolval remove_exn : t ‑> unitremove_exn path tries to remove the file at path from the
file system.
- Raises Sys_error: if there is no file at
path or access rights are wrong. - Since: 0.8
read_dir d returns a sequence of files and directory contained
-in the directory d (or an empty stream if d is not a directory)
- Raises Sys_error: in case of error (e.g. permission denied)
- Parameter recurse: if true (default
false), sub-directories are also
-explored
val read_exn : t ‑> stringRead the content of the given file, or raises some exception
- Raises Sys_error: in case of error
- Since: 0.16
val append_exn : t ‑> string ‑> unitAppend the given string into the given file, possibly raising
- Raises Sys_error: in case of error
- Since: 0.16
val write_exn : t ‑> string ‑> unitWrite the given string into the given file, possibly raising
- Raises Sys_error: in case of error
- Since: 0.16
Similar to read_dir (with recurse=true), this function walks
+in the directory d (or an empty stream if d is not a directory).
- Raises Sys_error: in case of error (e.g. permission denied).
- Parameter recurse: if true (default
false), sub-directories are also
+explored.
val read_exn : t ‑> stringRead the content of the given file, or raises some exception.
- Raises Sys_error: in case of error.
- Since: 0.16
val append_exn : t ‑> string ‑> unitAppend the given string into the given file, possibly raising.
- Raises Sys_error: in case of error.
- Since: 0.16
val write_exn : t ‑> string ‑> unitWrite the given string into the given file, possibly raising.
- Raises Sys_error: in case of error.
- Since: 0.16
Similar to read_dir (with recurse=true), this function walks
a directory recursively and yields either files or directories.
Is a file anything that doesn't satisfy is_directory (including
-symlinks, etc.)
- Raises Sys_error: in case of error (e.g. permission denied) during iteration
Same as walk but returns a list (therefore it's eager and might
-take some time on large directories)
- Since: 1.1
val show_walk_item : walk_item ‑> stringval with_temp : ?temp_dir:string ‑> prefix:string ‑> suffix:string ‑> (string ‑> 'a) ‑> 'awith_temp ~prefix ~suffix f will call f with the name of a new
+symlinks, etc.)
- Raises Sys_error: in case of error (e.g. permission denied) during iteration.
Like walk but returns a list (therefore it's eager and might
+take some time on large directories).
- Since: 1.1
val show_walk_item : walk_item ‑> stringval with_temp : ?temp_dir:string ‑> prefix:string ‑> suffix:string ‑> (string ‑> 'a) ‑> 'awith_temp ~prefix ~suffix f will call f with the name of a new
temporary file (located in temp_dir).
After f returns, the file is deleted. Best to be used in
combination with with_out.
-See Filename.temp_file
- Since: 0.17
\ No newline at end of file
+See Filename.temp_file.- Since: 0.17
\ No newline at end of file
diff --git a/2.0/containers/CCIO/index.html b/2.0/containers/CCIO/index.html
index 1796e878..192285b8 100644
--- a/2.0/containers/CCIO/index.html
+++ b/2.0/containers/CCIO/index.html
@@ -10,13 +10,13 @@ like Lwt or Async, that are far more comprehensive.Examples:
- o
write_gen oc chunks
)
)
- ) ;;
- Since: 0.6
- Before 0.12.was in 'containers.io', now moved into 'containers'
Input
val with_in : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> 'a) ‑> 'aOpen an input file with the given optional flag list, calls the function
+ ) ;;
- Since: 0.6
- Before 0.12.was in 'containers.io', now moved into 'containers'
Input
val with_in : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> 'a) ‑> 'aOpen an input file with the given optional flag list, calls the function
on the input channel. When the function raises or returns, the
-channel is closed.
- Raises Sys_error: in case of error (same as open_in and close_in)
- Parameter flags: opening flags (default
[Open_text]). Open_rdonly is used in any cases
val read_chunks : ?size:int ‑> Pervasives.in_channel ‑> string genRead the channel's content into chunks of size size
val read_line : Pervasives.in_channel ‑> string optionRead a line from the channel. Returns None if the input is terminated.
-The "\n" is removed from the line.
val read_lines : Pervasives.in_channel ‑> string genRead all lines. The generator should be traversed only once.
val read_all : ?size:int ‑> Pervasives.in_channel ‑> stringRead the whole channel into a buffer, then converted into a string.
- Parameter size: the internal buffer size
- Since: 0.7
val read_all_bytes : ?size:int ‑> Pervasives.in_channel ‑> Bytes.tRead the whole channel into a mutable byte array
- Parameter size: the internal buffer size
- Since: 0.12
Output
val with_out : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'aSame as with_in but for an output channel
- Parameter flags: opening flags (default
[Open_creat; Open_trunc; Open_text]). - Raises Sys_error: in case of error (same as open_out and close_out)
-
Open_wronly is used in any cases
val with_out_a : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'aSimilar to with_out but with the [Open_append; Open_creat; Open_wronly]
-flags activated, to append to the file.
- Raises Sys_error: in case of error (same as open_out and close_out)
val write_line : Pervasives.out_channel ‑> string ‑> unitWrite the given string on the channel, followed by "\n"
val write_gen : ?sep:string ‑> Pervasives.out_channel ‑> string gen ‑> unitWrite the given strings on the output. If provided, add sep between
-every two strings (but not at the end)
val write_lines : Pervasives.out_channel ‑> string gen ‑> unitWrite every string on the output, followed by "\n".
Both
val with_in_out : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> Pervasives.out_channel ‑> 'a) ‑> 'aMisc for Generators
tee funs gen behaves like gen, but each element is given to
+channel is closed.
- Raises Sys_error: in case of error (same as open_in and close_in).
- Parameter flags: opening flags (default
[Open_text]). Open_rdonly is used in any cases.
val read_chunks : ?size:int ‑> Pervasives.in_channel ‑> string genRead the channel's content into chunks of size size.
val read_line : Pervasives.in_channel ‑> string optionRead a line from the channel. Returns None if the input is terminated.
+The "\n" is removed from the line.
val read_lines : Pervasives.in_channel ‑> string genRead all lines. The generator should be traversed only once.
val read_all : ?size:int ‑> Pervasives.in_channel ‑> stringRead the whole channel into a buffer, then converted into a string.
- Parameter size: the internal buffer size.
- Since: 0.7
val read_all_bytes : ?size:int ‑> Pervasives.in_channel ‑> Bytes.tRead the whole channel into a mutable byte array.
- Parameter size: the internal buffer size.
- Since: 0.12
Output
val with_out : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'aLike with_in but for an output channel.
- Parameter flags: opening flags (default
[Open_creat; Open_trunc; Open_text]). - Raises Sys_error: in case of error (same as open_out and close_out).
+
Open_wronly is used in any cases.
val with_out_a : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'aSimilar to with_out but with the [Open_append; Open_creat; Open_wronly]
+flags activated, to append to the file.
- Raises Sys_error: in case of error (same as open_out and close_out).
val write_line : Pervasives.out_channel ‑> string ‑> unitWrite the given string on the channel, followed by "\n".
val write_gen : ?sep:string ‑> Pervasives.out_channel ‑> string gen ‑> unitWrite the given strings on the output. If provided, add sep between
+every two strings (but not at the end).
val write_lines : Pervasives.out_channel ‑> string gen ‑> unitWrite every string on the output, followed by "\n".
Both
val with_in_out : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> Pervasives.out_channel ‑> 'a) ‑> 'aMisc for Generators
tee funs gen behaves like gen, but each element is given to
every function f in funs at the time the element is produced.
File and file names
How to list recursively files in a directory:
# let files = CCIO.File.read_dir ~recurse:true (CCIO.File.make "/tmp");;
# CCIO.write_lines stdout files;;
See File.walk if you also need to list directories:
# let content = CCIO.File.walk (CCIO.File.make "/tmp");;
diff --git a/2.0/containers/CCInt/Infix/index.html b/2.0/containers/CCInt/Infix/index.html
index d9016bdb..6de54185 100644
--- a/2.0/containers/CCInt/Infix/index.html
+++ b/2.0/containers/CCInt/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCInt.Infix) Module CCInt.Infix
Infix Operators
- Since: 0.17
\ No newline at end of file
+Infix (containers.CCInt.Infix) Module CCInt.Infix
\ No newline at end of file
diff --git a/2.0/containers/CCInt/index.html b/2.0/containers/CCInt/index.html
index 5ebf04ab..6e50d147 100644
--- a/2.0/containers/CCInt/index.html
+++ b/2.0/containers/CCInt/index.html
@@ -1,9 +1,10 @@
-CCInt (containers.CCInt) Module CCInt
Basic Int functions
val hash : t ‑> intpow a b = a^b for positive integers a and b.
+
CCInt (containers.CCInt) Module CCInt
Basic Int functions
val hash : t ‑> intpow base exponent returns base raised to the power of exponent.
+pow a b = a^b for positive integers a and b.
Raises Invalid_argument if a = b = 0 or b < 0.
- Since: 0.11
floor_div a n is integer division rounding towards negative infinity.
It satisfies a = m * floor_div a n + rem a n.
- Since: 1.2
val random : int ‑> t random_genval random_small : t random_genval random_range : int ‑> int ‑> t random_genval random : int ‑> t random_genval random_small : t random_genval random_range : int ‑> int ‑> t random_genval to_string : t ‑> stringReturn the string representation of its argument, in signed decimal.
- Since: 0.13
range_by ~step i j iterates on integers from i to j included,
where the difference between successive elements is step.
-use a negative step for a decreasing list.
- Raises Invalid_argument: if
step=0 - Since: 1.2
range i j iterates on integers from i to j included . It works
-both for decreasing and increasing ranges
- Since: 1.2
Same as range but the second bound is excluded.
-For instance range' 0 5 = Sequence.of_list [0;1;2;3;4]
- Since: 1.2
\ No newline at end of file
+Use a negative step for a decreasing list.- Raises Invalid_argument: if
step=0. - Since: 1.2
range i j iterates on integers from i to j included . It works
+both for decreasing and increasing ranges.
- Since: 1.2
Like range but the second bound is excluded.
+For instance range' 0 5 = Sequence.of_list [0;1;2;3;4].
- Since: 1.2
Infix Operators
- Since: 0.17
module Infix : sig ... endinclude module type of Infix
\ No newline at end of file
diff --git a/2.0/containers/CCInt64/index.html b/2.0/containers/CCInt64/index.html
index 8b45357f..45432fc3 100644
--- a/2.0/containers/CCInt64/index.html
+++ b/2.0/containers/CCInt64/index.html
@@ -1,19 +1,19 @@
-CCInt64 (containers.CCInt64) Module CCInt64
Int64
Helpers for in64.
- Since: 0.13
Integer division. Raise Division_by_zero if the second
+
CCInt64 (containers.CCInt64) Module CCInt64
Int64
Helpers for 64-bit integers.
- Since: 0.13
Integer division. Raise Division_by_zero if the second
argument is zero. This division rounds the real quotient of
its arguments towards zero, as specified for Pervasives.(/).
x lsl y shifts x to the left by y bits, filling in with zeroes.
The result is unspecified if y < 0 or y >= 64.
x lsr y shifts x to the right by y bits.
This is a logical shift: zeroes are inserted in the vacated bits
regardless of the sign of x.
The result is unspecified if y < 0 or y >= 64.
x asr y shifts x to the right by y bits.
This is an arithmetic shift: the sign bit of x is replicated
and inserted in the vacated bits.
-The result is unspecified if y < 0 or y >= 64.
The comparison function for 64-bit integers, with the same specification as
+The result is unspecified if y < 0 or y >= 64.
The comparison function for 64-bit integers, with the same specification as
Pervasives.compare. Along with the type t, this function compare
allows the module CCInt64 to be passed as argument to the functors
-Set.Make and Map.Make.
Conversion
Conversion
val to_int : t ‑> intConvert the given 64-bit integer (type int64) to an
integer (type int). On 64-bit platforms, the 64-bit integer
is taken modulo 263, i.e. the high-order bit is lost
during the conversion. On 32-bit platforms, the 64-bit integer
diff --git a/2.0/containers/CCList/Assoc/index.html b/2.0/containers/CCList/Assoc/index.html
index fed6c509..7c33af60 100644
--- a/2.0/containers/CCList/Assoc/index.html
+++ b/2.0/containers/CCList/Assoc/index.html
@@ -1,4 +1,4 @@
-
Assoc (containers.CCList.Assoc) Module CCList.Assoc
val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, 'b) t ‑> 'bSame as get, but unsafe.
- Raises Not_found: if the element is not present.
val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, _) t ‑> boolmem x l returns true iff x is a key in l.
- Since: 0.16
update k ~f l updates l on the key k, by calling f (get l k)
+
Assoc (containers.CCList.Assoc) Module CCList.Assoc
val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, 'b) t ‑> 'bLike get, but unsafe.
- Raises Not_found: if the element is not present.
val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, _) t ‑> boolmem x l returns true iff x is a key in l.
- Since: 0.16
update k ~f l updates l on the key k, by calling f (get l k)
and removing k if it returns None, mapping k to v' if it
returns Some v'.
- Since: 0.16
\ No newline at end of file
diff --git a/2.0/containers/CCList/Infix/index.html b/2.0/containers/CCList/Infix/index.html
index 89a2900d..4ede567e 100644
--- a/2.0/containers/CCList/Infix/index.html
+++ b/2.0/containers/CCList/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCList.Infix) Module CCList.Infix
val (--) : int ‑> int ‑> int t
\ No newline at end of file
+Infix (containers.CCList.Infix) Module CCList.Infix
- Since: 0.17
\ No newline at end of file
diff --git a/2.0/containers/CCList/Traverse/argument-1-M/index.html b/2.0/containers/CCList/Traverse/argument-1-M/index.html
index 52c1255a..07caa0b7 100644
--- a/2.0/containers/CCList/Traverse/argument-1-M/index.html
+++ b/2.0/containers/CCList/Traverse/argument-1-M/index.html
@@ -1,2 +1,2 @@
-1-M (containers.CCList.Traverse.1-M) Parameter CCList.Traverse.1-M
val return : 'a ‑> 'a t
\ No newline at end of file
+1-M (containers.CCList.Traverse.1-M) Parameter CCList.Traverse.1-M
\ No newline at end of file
diff --git a/2.0/containers/CCList/Traverse/index.html b/2.0/containers/CCList/Traverse/index.html
index db72b442..5b32801a 100644
--- a/2.0/containers/CCList/Traverse/index.html
+++ b/2.0/containers/CCList/Traverse/index.html
@@ -1,4 +1,4 @@
-Traverse (containers.CCList.Traverse) Module CCList.Traverse
Parameters
Signature
Same as map_m but map_m_par f (x::l) evaluates f x and
+
Traverse (containers.CCList.Traverse) Module CCList.Traverse
Parameters
Signature
Like map_m but map_m_par f (x::l) evaluates f x and
f l "in parallel" before combining their result (for instance
in Lwt).
\ No newline at end of file
diff --git a/2.0/containers/CCList/index.html b/2.0/containers/CCList/index.html
index 1e06330b..e99edeaa 100644
--- a/2.0/containers/CCList/index.html
+++ b/2.0/containers/CCList/index.html
@@ -1,7 +1,7 @@
-CCList (containers.CCList) Module CCList
Complements to list
include module type of List
val empty : 'a tSafe version of List.append.
+
CCList (containers.CCList) Module CCList
Complements to list
include module type of List
Safe version of List.filter.
filter p l returns all the elements of the list l
that satisfy the predicate p. The order of the elements
@@ -44,27 +44,29 @@ will overlap; if offset > n, some elements will not
that length g < n, last g is called. If last g = Some g',
g' is appended; otherwise g is dropped.
If last = CCOpt.return, it will simply keep the last group.
-By default, last = fun _ -> None, i.e. the last group is dropped if shorter than n.
- Raises Invalid_argument: if
offset <= 0 or n <= 0. - Since: 1.0
val find_pred : ('a ‑> bool) ‑> 'a t ‑> 'a optionfind_pred p l finds the first element of l that satisfies p,
+By default, last = fun _ -> None, i.e. the last group is dropped if shorter than n.
- Raises Invalid_argument: if
offset <= 0 or n <= 0. - Since: 1.0
val find_pred : ('a ‑> bool) ‑> 'a t ‑> 'a optionfind_pred p l finds the first element of l that satisfies p,
or returns None if no element satisfies p.
- Since: 0.11
val find_pred_exn : ('a ‑> bool) ‑> 'a t ‑> 'aUnsafe version of find_pred.
- Raises Not_found: if no such element is found.
- Since: 0.11
val find_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b optionfind_map f l traverses l, applying f to each element. If for
some element x, f x = Some y, then Some y is returned. Otherwise
the call returns None.
- Since: 0.11
val find_mapi : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b optionLike find_map, but also pass the index to the predicate function.
- Since: 0.11
val find_idx : ('a ‑> bool) ‑> 'a t ‑> (int * 'a) optionfind_idx p x returns Some (i,x) where x is the i-th element of l,
-and p x holds. Otherwise returns None.
all_some l returns Some l' if all elements of l are of the form Some x,
+and p x holds. Otherwise returns None.
remove ~x l removes every instance of x from l. Tail-recursive.
- Parameter eq: equality function.
- Since: 0.11
filter_map f l is the sublist of l containing only elements for which
+f returns Some e.
+Map and remove elements at the same time.
all_some l returns Some l' if all elements of l are of the form Some x,
or None otherwise.
- Since: 1.3
all_ok l returns Ok l' if all elements of l are of the form Ok x,
-or Error e otherwise (with the first error met).
- Since: 1.3
val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listMerges elements from both sorted list.
val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a listSort the list and remove duplicate elements.
val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listsorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and
+or Error e otherwise (with the first error met).
- Since: 1.3
val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listMerge elements from both sorted list.
val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a listSort the list and remove duplicate elements.
val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listsorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and
removes duplicates.
- Since: 0.10
val is_sorted : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> boolis_sorted l returns true iff l is sorted (according to given order).
- Parameter cmp: the comparison function (default
Pervasives.compare). - Since: 0.17
val sorted_insert : cmp:('a ‑> 'a ‑> int) ‑> ?uniq:bool ‑> 'a ‑> 'a list ‑> 'a listsorted_insert x l inserts x into l such that, if l was sorted,
then sorted_insert x l is sorted too.
- Parameter uniq: if true and
x is already in sorted position in l, then
x is not duplicated. Default false (x will be inserted in any case). - Since: 0.17
val uniq_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a listuniq_succ l removes duplicate elements that occur one next to the other.
Examples:
uniq_succ [1;2;1] = [1;2;1].
uniq_succ [1;1;2] = [1;2].
- Since: 0.10
val group_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list listgroup_succ ~eq l groups together consecutive elements that are equal
-according to eq.
- Since: 0.11
Indices
Same as map, but the function is applied to the index of
+according to eq.
- Since: 0.11
Indices
Like map, but the function is applied to the index of
the element as first argument (counting from 0), and the element
-itself as second argument.
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitSame as iter, but the function is applied to the index of
+itself as second argument.
val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitLike iter, but the function is applied to the index of
the element as first argument (counting from 0), and the element
-itself as second argument.
Fold on two lists, with index.
- Raises Invalid_argument: when lists do not have the same length.
- Since: 2.0
val foldi : ('b ‑> int ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'bLike fold but it also passes in the index of each element to the folded function.
Fold on two lists, with index.
- Raises Invalid_argument: when lists do not have the same length.
- Since: 2.0
val get_at_idx : int ‑> 'a t ‑> 'a optionGet by index in the list.
If the index is negative, it will get element starting from the end
of the list.
val nth_opt : 'a t ‑> int ‑> 'a optionSafe version of nth.
- Raises Invalid_argument: if the int is negative.
- Since: 1.5
val get_at_idx_exn : int ‑> 'a t ‑> 'aGet the i-th element, or
- Raises Not_found: if the index is invalid.
If the index is negative, it will get element starting from the end
@@ -83,8 +85,8 @@ Complexity is quadratic in the length of the list, but the order
of elements is preserved. If you wish for a faster de-duplication
but do not care about the order, use sort_uniq.
Other Constructors
val range_by : step:int ‑> int ‑> int ‑> int trange_by ~step i j iterates on integers from i to j included,
where the difference between successive elements is step.
-use a negative step for a decreasing list.
- Raises Invalid_argument: if
step=0. - Since: 0.18
val range : int ‑> int ‑> int trange i j iterates on integers from i to j included. It works
-both for decreasing and increasing ranges.
val range' : int ‑> int ‑> int tSame as range but the second bound is excluded.
-For instance range' 0 5 = [0;1;2;3;4].
Association Lists
module Assoc : sig ... endReferences on Lists
- Since: 0.3.3
module Ref : sig ... endConversions
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genval random_choose : 'a t ‑> 'a random_genRandomly choose an element in the list.
- Raises Not_found: if the list is empty.
val random_sequence : 'a random_gen t ‑> 'a t random_genInfix Operators
+Use a negative step for a decreasing list.
- Raises Invalid_argument: if
step=0. - Since: 0.18
val range : int ‑> int ‑> int trange i j iterates on integers from i to j included. It works
+both for decreasing and increasing ranges.
val range' : int ‑> int ‑> int tLike range but the second bound is excluded.
+For instance range' 0 5 = [0;1;2;3;4].
Association Lists
module Assoc : sig ... endReferences on Lists
- Since: 0.3.3
module Ref : sig ... endConversions
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genval random_choose : 'a t ‑> 'a random_genRandomly choose an element in the list.
- Raises Not_found: if the list is empty.
val random_sequence : 'a random_gen t ‑> 'a t random_genInfix Operators
It is convenient to open CCList.Infix to access the infix operators
-without cluttering the scope too much.
- Since: 0.16
module Infix : sig ... endIO
Lists of pairs
\ No newline at end of file
+without cluttering the scope too much.- Since: 0.16
module Infix : sig ... endIO
Lists of pairs
\ No newline at end of file
diff --git a/2.0/containers/CCList/module-type-MONAD/index.html b/2.0/containers/CCList/module-type-MONAD/index.html
index 4f5d29ec..732eec61 100644
--- a/2.0/containers/CCList/module-type-MONAD/index.html
+++ b/2.0/containers/CCList/module-type-MONAD/index.html
@@ -1,2 +1,2 @@
-MONAD (containers.CCList.MONAD) Module type CCList.MONAD
Monadic Operations
val return : 'a ‑> 'a t
\ No newline at end of file
+MONAD (containers.CCList.MONAD) Module type CCList.MONAD
Monadic Operations
\ No newline at end of file
diff --git a/2.0/containers/CCListLabels/Assoc/index.html b/2.0/containers/CCListLabels/Assoc/index.html
index 1a823796..03850fd6 100644
--- a/2.0/containers/CCListLabels/Assoc/index.html
+++ b/2.0/containers/CCListLabels/Assoc/index.html
@@ -1,4 +1,4 @@
-Assoc (containers.CCListLabels.Assoc) Module CCListLabels.Assoc
val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, 'b) t ‑> 'bSame as get, but unsafe.
- Raises Not_found: if the element is not present.
val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, _) t ‑> boolmem x l returns true iff x is a key in l.
- Since: 0.16
update k ~f l updates l on the key k, by calling f (get l k)
+
Assoc (containers.CCListLabels.Assoc) Module CCListLabels.Assoc
val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, 'b) t ‑> 'bLike get, but unsafe.
- Raises Not_found: if the element is not present.
val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a, _) t ‑> boolmem x l returns true iff x is a key in l.
- Since: 0.16
update k ~f l updates l on the key k, by calling f (get l k)
and removing k if it returns None, mapping k to v' if it
returns Some v'.
- Since: 0.16
\ No newline at end of file
diff --git a/2.0/containers/CCListLabels/Infix/index.html b/2.0/containers/CCListLabels/Infix/index.html
index 1e7b32d9..db928795 100644
--- a/2.0/containers/CCListLabels/Infix/index.html
+++ b/2.0/containers/CCListLabels/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCListLabels.Infix) Module CCListLabels.Infix
val (--) : int ‑> int ‑> int t
\ No newline at end of file
+Infix (containers.CCListLabels.Infix) Module CCListLabels.Infix
- Since: 0.17
\ No newline at end of file
diff --git a/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html b/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html
index a48aa782..4d3ab9eb 100644
--- a/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html
+++ b/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html
@@ -1,2 +1,2 @@
-1-M (containers.CCListLabels.Traverse.1-M) Parameter CCListLabels.Traverse.1-M
val return : 'a ‑> 'a t
\ No newline at end of file
+1-M (containers.CCListLabels.Traverse.1-M) Parameter CCListLabels.Traverse.1-M
\ No newline at end of file
diff --git a/2.0/containers/CCListLabels/Traverse/index.html b/2.0/containers/CCListLabels/Traverse/index.html
index 2c250e0c..e8fbf9d2 100644
--- a/2.0/containers/CCListLabels/Traverse/index.html
+++ b/2.0/containers/CCListLabels/Traverse/index.html
@@ -1,4 +1,4 @@
-Traverse (containers.CCListLabels.Traverse) Module CCListLabels.Traverse
Parameters
Signature
Same as map_m but map_m_par f (x::l) evaluates f x and
+
Traverse (containers.CCListLabels.Traverse) Module CCListLabels.Traverse
Parameters
Signature
Like map_m but map_m_par f (x::l) evaluates f x and
f l "in parallel" before combining their result (for instance
in Lwt).
\ No newline at end of file
diff --git a/2.0/containers/CCListLabels/index.html b/2.0/containers/CCListLabels/index.html
index 4348f8f0..ad99f74d 100644
--- a/2.0/containers/CCListLabels/index.html
+++ b/2.0/containers/CCListLabels/index.html
@@ -1,33 +1,40 @@
-CCListLabels (containers.CCListLabels) Module CCListLabels
Complements to list
include module type of ListLabels
val empty : 'a tSafe version of List.append.
+
CCListLabels (containers.CCListLabels) Module CCListLabels
Complements to list
include module type of ListLabels
val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'aFold until a stop condition via ('a, `Stop) is
-indicated by the accumulator.
- Since: 0.8
val fold_map : f:('acc ‑> 'a ‑> 'acc * 'b) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b listfold_map f acc l is a fold_left-like function, but it also maps the
-list to another list.
- Since: 0.14
val fold_map2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc * 'c) ‑> init:'acc ‑> 'a list ‑> 'b list ‑> 'acc * 'c listfold_map2 is to fold_map what List.map2 is to List.map.
- Raises Invalid_argument: if the lists do not have the same length.
- Since: 0.16
val fold_filter_map : f:('acc ‑> 'a ‑> 'acc * 'b option) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b listfold_filter_map f acc l is a fold_left-like function, but also
+cons_maybe None l is l.
- Since: 0.13
Safe version of List.filter.
+filter p l returns all the elements of the list l
+that satisfy the predicate p. The order of the elements
+in the input list is preserved.
val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'bSafe version of fold_right.
+fold_right f [a1; ...; an] b is
+f a1 (f a2 (... (f an b) ...)). Not tail-recursive.
val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'aFold until a stop condition via ('a, `Stop) is
+indicated by the accumulator.
- Since: 0.8
val fold_map : f:('acc ‑> 'a ‑> 'acc * 'b) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b listfold_map ~f ~init l is a fold_left-like function, but it also maps the
+list to another list.
- Since: 0.14
val fold_map2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc * 'c) ‑> init:'acc ‑> 'a list ‑> 'b list ‑> 'acc * 'c listfold_map2 is to fold_map what List.map2 is to List.map.
- Raises Invalid_argument: if the lists do not have the same length.
- Since: 0.16
val fold_filter_map : f:('acc ‑> 'a ‑> 'acc * 'b option) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b listfold_filter_map ~f ~init l is a fold_left-like function, but also
generates a list of output in a way similar to filter_map.
- Since: 0.17
val fold_flat_map : f:('acc ‑> 'a ‑> 'acc * 'b list) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b listfold_flat_map f acc l is a fold_left-like function, but it also maps the
-list to a list of lists that is then flatten'd.
- Since: 0.14
val init : int ‑> f:(int ‑> 'a) ‑> 'a tinit len f is f 0; f 1; ...; f (len-1).
- Raises Invalid_argument: if len < 0.
- Since: 0.6
All pairs of distinct positions of the list. list_diagonal l will
-return the list of List.nth i l, List.nth j l if i < j.
val partition_map : f:('a ‑> [< `Left of 'b | `Right of 'c | `Drop ]) ‑> 'a list ‑> 'b list * 'c listpartition_map f l maps f on l and gather results in lists:
+list to a list of lists that is then flatten'd.
- Since: 0.14
val init : int ‑> f:(int ‑> 'a) ‑> 'a tinit len ~f is f 0; f 1; ...; f (len-1).
- Raises Invalid_argument: if len < 0.
- Since: 0.6
All pairs of distinct positions of the list. list_diagonal l will
+return the list of List.nth i l, List.nth j l if i < j.
val partition_map : f:('a ‑> [< `Left of 'b | `Right of 'c | `Drop ]) ‑> 'a list ‑> 'b list * 'c listpartition_map ~f l maps f on l and gather results in lists:
- if
f x = `Left y, adds y to the first list. - if
f x = `Right z, adds z to the second list. - if
f x = `Drop, ignores x.
- Since: 0.11
val sublists_of_len : ?last:('a list ‑> 'a list option) ‑> ?offset:int ‑> len:int ‑> 'a list ‑> 'a list listsublists_of_len n l returns sub-lists of l that have length n.
By default, these sub-lists are non overlapping:
-sublists_of_len 2 [1;2;3;4;5;6] returns [1;2]; [3;4]; [5;6].
See CCList.sublists_of_len for more details.
- Since: 1.5
val find_pred : f:('a ‑> bool) ‑> 'a t ‑> 'a optionfind_pred p l finds the first element of l that satisfies p,
-or returns None if no element satisfies p.
- Since: 0.11
val find_pred_exn : f:('a ‑> bool) ‑> 'a t ‑> 'aUnsafe version of find_pred.
- Raises Not_found: if no such element is found.
- Since: 0.11
val find_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b optionfind_map f l traverses l, applying f to each element. If for
+sublists_of_len 2 [1;2;3;4;5;6] returns [1;2]; [3;4]; [5;6].
See CCList.sublists_of_len for more details.
- Since: 1.5
val find_pred : f:('a ‑> bool) ‑> 'a t ‑> 'a optionfind_pred p l finds the first element of l that satisfies p,
+or returns None if no element satisfies p.
- Since: 0.11
val find_pred_exn : f:('a ‑> bool) ‑> 'a t ‑> 'aUnsafe version of find_pred.
- Raises Not_found: if no such element is found.
- Since: 0.11
val find_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b optionfind_map ~f l traverses l, applying f to each element. If for
some element x, f x = Some y, then Some y is returned. Otherwise
the call returns None.
- Since: 0.11
val find_mapi : f:(int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b optionLike find_map, but also pass the index to the predicate function.
- Since: 0.11
val find_idx : f:('a ‑> bool) ‑> 'a t ‑> (int * 'a) optionfind_idx p x returns Some (i,x) where x is the i-th element of l,
-and p x holds. Otherwise returns None.
remove ~key l removes every instance of key from l. Tailrec.
- Parameter eq: equality function.
- Since: 0.11
val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listMerges elements from both sorted list.
val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a listSort the list and remove duplicate elements.
val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listsorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and
+and p x holds. Otherwise returns None.
remove ~key l removes every instance of key from l. Tail-recursive.
- Parameter eq: equality function.
- Since: 0.11
filter_map ~f l is the sublist of l containing only elements for which
+f returns Some e.
+Map and remove elements at the same time.
val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listMerges elements from both sorted list.
val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a listSort the list and remove duplicate elements.
val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a listsorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and
removes duplicates.
- Since: 0.10
val is_sorted : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> boolis_sorted l returns true iff l is sorted (according to given order).
- Parameter cmp: the comparison function (default
Pervasives.compare). - Since: 0.17
val sorted_insert : cmp:('a ‑> 'a ‑> int) ‑> ?uniq:bool ‑> 'a ‑> 'a list ‑> 'a listsorted_insert x l inserts x into l such that, if l was sorted,
then sorted_insert x l is sorted too.
- Parameter uniq: if true and
x is already in sorted position in l, then
x is not duplicated. Default false (x will be inserted in any case). - Since: 0.17
val uniq_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a listuniq_succ l removes duplicate elements that occur one next to the other.
Examples:
uniq_succ [1;2;1] = [1;2;1].
uniq_succ [1;1;2] = [1;2].
- Since: 0.10
val group_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list listgroup_succ ~eq l groups together consecutive elements that are equal
-according to eq.
- Since: 0.11
Indices
Same as map, but the function is applied to the index of
+according to eq.
- Since: 0.11
Indices
Like map, but the function is applied to the index of
the element as first argument (counting from 0), and the element
-itself as second argument.
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unitSame as iter, but the function is applied to the index of
+itself as second argument.
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unitLike iter, but the function is applied to the index of
the element as first argument (counting from 0), and the element
-itself as second argument.
val foldi : f:('b ‑> int ‑> 'a ‑> 'b) ‑> init:'b ‑> 'a t ‑> 'bLike fold but it also passes in the index of each element to the folded function.
val get_at_idx : int ‑> 'a t ‑> 'a optionGet by index in the list.
If the index is negative, it will get element starting from the end
of the list.
val get_at_idx_exn : int ‑> 'a t ‑> 'aGet the i-th element, or
- Raises Not_found: if the index is invalid.
If the index is negative, it will get element starting from the end
@@ -47,7 +54,7 @@ of elements is preserved. If you wish for a faster de-duplication
but do not care about the order, use sort_uniq.
Other Constructors
val range_by : step:int ‑> int ‑> int ‑> int trange_by ~step i j iterates on integers from i to j included,
where the difference between successive elements is step.
use a negative step for a decreasing list.
- Raises Invalid_argument: if
step=0. - Since: 0.18
val range : int ‑> int ‑> int trange i j iterates on integers from i to j included. It works
-both for decreasing and increasing ranges.
val range' : int ‑> int ‑> int tSame as range but the second bound is excluded.
-For instance range' 0 5 = [0;1;2;3;4].
Association Lists
module Assoc : sig ... endReferences on Lists
- Since: 0.3.3
module Ref : sig ... endConversions
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genval random_choose : 'a t ‑> 'a random_genRandomly choose an element in the list.
- Raises Not_found: if the list is empty.
val random_sequence : 'a random_gen t ‑> 'a t random_genInfix Operators
+both for decreasing and increasing ranges.
val range' : int ‑> int ‑> int tLike range but the second bound is excluded.
+For instance range' 0 5 = [0;1;2;3;4].
Association Lists
module Assoc : sig ... endReferences on Lists
- Since: 0.3.3
module Ref : sig ... endConversions
val random : 'a random_gen ‑> 'a t random_genval random_non_empty : 'a random_gen ‑> 'a t random_genval random_len : int ‑> 'a random_gen ‑> 'a t random_genval random_choose : 'a t ‑> 'a random_genRandomly choose an element in the list.
- Raises Not_found: if the list is empty.
val random_sequence : 'a random_gen t ‑> 'a t random_genInfix Operators
It is convenient to open CCList.Infix to access the infix operators
-without cluttering the scope too much.
- Since: 0.16
module Infix : sig ... endIO
\ No newline at end of file
+without cluttering the scope too much.- Since: 0.16
module Infix : sig ... endIO
\ No newline at end of file
diff --git a/2.0/containers/CCListLabels/module-type-MONAD/index.html b/2.0/containers/CCListLabels/module-type-MONAD/index.html
index 06c4ef62..c74a4bba 100644
--- a/2.0/containers/CCListLabels/module-type-MONAD/index.html
+++ b/2.0/containers/CCListLabels/module-type-MONAD/index.html
@@ -1,2 +1,2 @@
-MONAD (containers.CCListLabels.MONAD) Module type CCListLabels.MONAD
Monadic Operations
val return : 'a ‑> 'a t
\ No newline at end of file
+MONAD (containers.CCListLabels.MONAD) Module type CCListLabels.MONAD
Monadic Operations
\ No newline at end of file
diff --git a/2.0/containers/CCMap/module-type-S/index.html b/2.0/containers/CCMap/module-type-S/index.html
index 782d2cc7..258d9afa 100644
--- a/2.0/containers/CCMap/module-type-S/index.html
+++ b/2.0/containers/CCMap/module-type-S/index.html
@@ -4,7 +4,7 @@ and returns default otherwise (if k
otherwise it calls f None. In any case, if the result is Nonek is removed from m, and if the result is Some v' then
add k v' m is returned.Safe version of find_first.
- Since: 1.5
val merge_safe : f:(key ‑> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c tmerge_safe ~f a b merges the maps a and b together.
- Since: 0.17
Build a map from the given list of bindings k_i -> v_i,
added in order using add.
If a key occurs several times, only its last binding
will be present in the result.
\ No newline at end of file
diff --git a/2.0/containers/CCOpt/Infix/index.html b/2.0/containers/CCOpt/Infix/index.html
index da6d4f4f..ef52846b 100644
--- a/2.0/containers/CCOpt/Infix/index.html
+++ b/2.0/containers/CCOpt/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCOpt.Infix) Module CCOpt.Infix
\ No newline at end of file
+Infix (containers.CCOpt.Infix) Module CCOpt.Infix
\ No newline at end of file
diff --git a/2.0/containers/CCOpt/index.html b/2.0/containers/CCOpt/index.html
index e55fd1b9..851cd7dc 100644
--- a/2.0/containers/CCOpt/index.html
+++ b/2.0/containers/CCOpt/index.html
@@ -1,9 +1,10 @@
-CCOpt (containers.CCOpt) Module CCOpt
Options
val map_or : default:'b ‑> ('a ‑> 'b) ‑> 'a t ‑> 'bmap_or ~default f o is f x if o = Some x, default otherwise
- Since: 0.16
val map_lazy : (unit ‑> 'b) ‑> ('a ‑> 'b) ‑> 'a t ‑> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise
- Since: 1.2
val is_some : _ t ‑> boolval get_or : default:'a ‑> 'a t ‑> 'aget_or ~default o extracts the value from o, or
-returns default if o = None.
- Since: 0.18
val get_exn : 'a t ‑> 'aOpen the option, possibly failing if it is None
- Raises Invalid_argument: if the option is
None
val get_lazy : (unit ‑> 'a) ‑> 'a t ‑> 'aget_lazy default_fn x unwraps x, but if x = None it returns default_fn () instead.
- Since: 0.6.1
sequence_l [x1; x2; ...; xn] returns Some [y1;y2;...;yn] if
+
CCOpt (containers.CCOpt) Module CCOpt
Options
val map_or : default:'b ‑> ('a ‑> 'b) ‑> 'a t ‑> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
- Since: 0.16
val map_lazy : (unit ‑> 'b) ‑> ('a ‑> 'b) ‑> 'a t ‑> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
- Since: 1.2
Compare two options, using custom comparators for the value.
+None is always assumed to be less than Some _.
val exists : ('a ‑> bool) ‑> 'a t ‑> boolReturn true iff there exists an element for which the provided function evaluates to true.
- Since: 0.17
val for_all : ('a ‑> bool) ‑> 'a t ‑> boolReturn true iff the provided function evaluates to true for all elements.
- Since: 0.17
val get_or : default:'a ‑> 'a t ‑> 'aget_or ~default o extracts the value from o, or
+returns default if o = None.
- Since: 0.18
val get_exn : 'a t ‑> 'aOpen the option, possibly failing if it is None.
- Raises Invalid_argument: if the option is
None.
val get_lazy : (unit ‑> 'a) ‑> 'a t ‑> 'aget_lazy default_fn x unwraps x, but if x = None it returns default_fn () instead.
- Since: 0.6.1
sequence_l [x1; x2; ...; xn] returns Some [y1;y2;...;yn] if
every xi is Some yi. Otherwise, if the list contains at least
one None, the result is None.
val wrap : ?handler:(exn ‑> bool) ‑> ('a ‑> 'b) ‑> 'a ‑> 'b optionwrap f x calls f x and returns Some y if f x = y. If f x raises
any exception, the result is None. This can be useful to wrap functions
such as Map.S.find.
- Parameter handler: the exception handler, which returns
true if the
-exception is to be caught.
val wrap2 : ?handler:(exn ‑> bool) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c optionwrap2 f x y is similar to wrap1 but for binary functions.
Applicative
Alternatives
Infix Operators
- Since: 0.16
module Infix : sig ... endConversion and IO
val to_list : 'a t ‑> 'a listval random : 'a random_gen ‑> 'a t random_genchoice_seq s is similar to choice, but works on sequences.
+exception is to be caught.
val wrap2 : ?handler:(exn ‑> bool) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c optionwrap2 f x y is similar to wrap but for binary functions.
Applicative
Alternatives
Infix Operators
- Since: 0.16
module Infix : sig ... endConversion and IO
val to_list : 'a t ‑> 'a listval random : 'a random_gen ‑> 'a t random_genchoice_seq s is similar to choice, but works on sequences.
It returns the first Some x occurring in s, or None otherwise.
- Since: 0.13
\ No newline at end of file
diff --git a/2.0/containers/CCOrd/Infix/index.html b/2.0/containers/CCOrd/Infix/index.html
index e9b06f2f..518312f2 100644
--- a/2.0/containers/CCOrd/Infix/index.html
+++ b/2.0/containers/CCOrd/Infix/index.html
@@ -1,2 +1,4 @@
-Infix (containers.CCOrd.Infix) Module CCOrd.Infix
val (<?>) : int ‑> ('a t * 'a * 'a) ‑> int
\ No newline at end of file
+Infix (containers.CCOrd.Infix) Module CCOrd.Infix
val (<?>) : int ‑> ('a t * 'a * 'a) ‑> intc1 <?> (ord, x, y) returns the same as c1 if c1 is not 0;
+otherwise it uses ord to compare the two values x and y,
+of type 'a.
\ No newline at end of file
diff --git a/2.0/containers/CCOrd/index.html b/2.0/containers/CCOrd/index.html
index 4fa645dd..bf28fcc5 100644
--- a/2.0/containers/CCOrd/index.html
+++ b/2.0/containers/CCOrd/index.html
@@ -1,5 +1,5 @@
-CCOrd (containers.CCOrd) Module CCOrd
Comparisons
val int : int tval string : string tval bool : bool tval float : float tLexicographic Combination
val (<?>) : int ‑> ('a t * 'a * 'a) ‑> intc1 <?> (ord, x, y) returns the same as c1 if c1 is not 0;
+
CCOrd (containers.CCOrd) Module CCOrd
Comparisons
val int : int tval string : string tval bool : bool tval float : float tLexicographic Combination
val (<?>) : int ‑> ('a t * 'a * 'a) ‑> intc1 <?> (ord, x, y) returns the same as c1 if c1 is not 0;
otherwise it uses ord to compare the two values x and y,
of type 'a.
Example:
CCInt.compare 1 3
@@ -7,9 +7,9 @@ of type 'a.Example:
<?> (CCBool.compare, true, false)
Same example, using only CCOrd::
CCOrd.(int 1 3
<?> (string, "a", "b")
- <?> (bool, true, false))
map f ord is the comparison function that, given objects x and y,
projects x and y using f (e.g. using a record field) and then
compares those projections with ord.
Example:
map fst CCInt.compare compares values of type (int * 'a) by their
-first component.
module Infix : sig ... end
\ No newline at end of file
+first component.module Infix : sig ... end
\ No newline at end of file
diff --git a/2.0/containers/CCPair/index.html b/2.0/containers/CCPair/index.html
index 2f8885dd..e236b9aa 100644
--- a/2.0/containers/CCPair/index.html
+++ b/2.0/containers/CCPair/index.html
@@ -1,4 +1,4 @@
-CCPair (containers.CCPair) Module CCPair
Tuple Functions
val (&&&) : ('a ‑> 'b) ‑> ('a ‑> 'c) ‑> 'a ‑> 'b * 'cf &&& g is fun x -> f x, g x. It splits the computations into
-two parts
val dup_map : ('a ‑> 'b) ‑> 'a ‑> 'a * 'bdup_map f x = (x, f x). Duplicates the value and applies the function
-to the second copy.
- Since: 0.3.3
\ No newline at end of file
+CCPair (containers.CCPair) Module CCPair
Tuple Functions
val map : ('a ‑> 'c) ‑> ('b ‑> 'd) ‑> ('a * 'b) ‑> 'c * 'dSynonym to ( *** ). Map on both sides of a tuple.
val map_same : ('a ‑> 'b) ‑> ('a * 'a) ‑> 'b * 'bLike map but specialized for pairs with elements of the same type.
val (&&&) : ('a ‑> 'b) ‑> ('a ‑> 'c) ‑> 'a ‑> 'b * 'cf &&& g is fun x -> f x, g x. It splits the computations into
+two parts.
val dup_map : ('a ‑> 'b) ‑> 'a ‑> 'a * 'bdup_map f x = (x, f x). Duplicates the value and applies the function
+to the second copy.
- Since: 0.3.3
\ No newline at end of file
diff --git a/2.0/containers/CCParse/Infix/index.html b/2.0/containers/CCParse/Infix/index.html
index d14cabdd..2db2c0dc 100644
--- a/2.0/containers/CCParse/Infix/index.html
+++ b/2.0/containers/CCParse/Infix/index.html
@@ -1,2 +1,13 @@
-Infix (containers.CCParse.Infix) Module CCParse.Infix
\ No newline at end of file
+Infix (containers.CCParse.Infix) Module CCParse.Infix
Monadic bind.
+p >>= f results in a new parser which behaves as p then,
+in case of success, applies f to the result.
a <?> msg behaves like a, but if a fails without
+consuming any input, it fails with msg
+instead. Useful as the last choice in a series of <|>:
+a <|> b <|> c <?> "expected a|b|c".
\ No newline at end of file
diff --git a/2.0/containers/CCParse/U/index.html b/2.0/containers/CCParse/U/index.html
index 1edd3837..317eebba 100644
--- a/2.0/containers/CCParse/U/index.html
+++ b/2.0/containers/CCParse/U/index.html
@@ -1,6 +1,6 @@
U (containers.CCParse.U) Module CCParse.U
list p parses a list of p, with the OCaml conventions for
start token "", stop token "" and separator ";".
-Whitespace between items are skipped
val int : int tval triple : ?start:string ‑> ?stop:string ‑> ?sep:string ‑> 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) tParse a triple using OCaml whitespace conventions.
The default is "(a, b, c)".
\ No newline at end of file
diff --git a/2.0/containers/CCParse/index.html b/2.0/containers/CCParse/index.html
index 69ad681b..83bcba9e 100644
--- a/2.0/containers/CCParse/index.html
+++ b/2.0/containers/CCParse/index.html
@@ -26,24 +26,26 @@ This makes a list of 100_000 integers, prints it and parses it back.
val string_of_branch : parse_branch ‑> stringInput
val state_of_string : string ‑> stateCombinators
Takes the input and two continuations:
-
ok to call with the result when it's doneerr to call when the parser met an error
- Raises ParseError: in case of failure
a <|> b tries to parse a, and if a fails without
+ assert (l=l');;
val string_of_branch : parse_branch ‑> stringInput
val state_of_string : string ‑> stateCombinators
Takes the input and two continuations:
+
ok to call with the result when it's doneerr to call when the parser met an error
- Raises ParseError: in case of failure.
Monadic bind.
+p >>= f results in a new parser which behaves as p then,
+in case of success, applies f to the result.
a <?> msg behaves like a, but if a fails without
+to avoid wrapping large parsers with try_).
a <?> msg behaves like a, but if a fails without
consuming any input, it fails with msg
instead. Useful as the last choice in a series of <|>:
-a <|> b <|> c <?> "expected a|b|c"
Memoize the parser. memo p will behave like p, but when called
in a state (read: position in input) it has already processed, memo p
returns a result directly. The implementation uses an underlying
hashtable.
This can be costly in memory, but improve the run time a lot if there
-is a lot of backtracking involving p.
This function is not thread-safe.
Parse
Those functions have a label ~p on the parser, since 0.14.
Infix
module Infix : sig ... endUtils
This is useful to parse OCaml-like values in a simple way.
module U : sig ... end
\ No newline at end of file
+is a lot of backtracking involving p.This function is not thread-safe.
Parse
Those functions have a label ~p on the parser, since 0.14.
Infix
module Infix : sig ... endUtils
This is useful to parse OCaml-like values in a simple way.
module U : sig ... end
\ No newline at end of file
diff --git a/2.0/containers/CCRandom/index.html b/2.0/containers/CCRandom/index.html
index a4f36728..f834c75c 100644
--- a/2.0/containers/CCRandom/index.html
+++ b/2.0/containers/CCRandom/index.html
@@ -1,6 +1,6 @@
CCRandom (containers.CCRandom) Module CCRandom
Random Generators
val return : 'a ‑> 'a treturn x is the generator that always returns x.
-Example: let random_int = return 4 (* fair dice roll *).
Delay evaluation. Useful for side-effectful generators that
+Example: let random_int = return 4 (* fair dice roll *).
Delay evaluation. Useful for side-effectful generators that
need some code to run for every call.
Example:
let gensym = let r = ref 0 in fun () -> incr r; !r ;;
@@ -8,10 +8,10 @@ Example:
delay (fun () ->
let name = gensym() in
small_int >>= fun i -> return (name,i)
- )
- Since: 0.4
Same as choose but without option.
- Raises Invalid_argument: if the list is empty.
val choose_return : 'a list ‑> 'a tChoose among the list.
- Raises Invalid_argument: if the list is empty
Like choose but without option.
- Raises Invalid_argument: if the list is empty.
val choose_return : 'a list ‑> 'a tChoose among the list.
- Raises Invalid_argument: if the list is empty.
sample_without_replacement n g makes a list of n elements which are all
generated randomly using g with the added constraint that none of the generated
-random values are equal.
- Raises Invalid_argument: if
n <= 0. - Since: 0.15
val pick_list : 'a list ‑> 'a tPick an element at random from the list.
- Raises Pick_from_empty: if the list is empty.
- Since: 0.16
val pick_array : 'a array ‑> 'a tPick an element at random from the array.
- Raises Pick_from_empty: if the array is empty.
- Since: 0.16
val small_int : int tval int : int ‑> int tval float_range : float ‑> float ‑> float tInclusive range. float_range a b assumes a < b.
- Since: 0.6.1
val split : int ‑> (int * int) option tSplit a positive value n into n1,n2 where n = n1 + n2.
- Returns
None if the value is too small.
val split_list : int ‑> len:int ‑> int list option tSplit a value n into a list of values whose sum is n
+random values are equal.
- Raises Invalid_argument: if
n <= 0. - Since: 0.15
val pick_list : 'a list ‑> 'a tPick an element at random from the list.
- Raises Pick_from_empty: if the list is empty.
- Since: 0.16
val pick_array : 'a array ‑> 'a tPick an element at random from the array.
- Raises Pick_from_empty: if the array is empty.
- Since: 0.16
val float_range : float ‑> float ‑> float tInclusive range. float_range a b assumes a < b.
- Since: 0.6.1
val split : int ‑> (int * int) option tSplit a positive value n into n1,n2 where n = n1 + n2.
- Returns
None if the value is too small.
val split_list : int ‑> len:int ‑> int list option tSplit a value n into a list of values whose sum is n
and whose length is length. The list is never empty and does not
contain 0.
- Raises Invalid_argument: if
len <= 1. - Returns
None if the value is too small.
retry g calls g until it returns some value, or until the maximum
number of retries was reached. If g fails,
diff --git a/2.0/containers/CCRef/index.html b/2.0/containers/CCRef/index.html
index d0beddee..f1787792 100644
--- a/2.0/containers/CCRef/index.html
+++ b/2.0/containers/CCRef/index.html
@@ -1,2 +1,2 @@
-
CCRef (containers.CCRef) Module CCRef
References
- Since: 0.9
val incr_then_get : int t ‑> intincr_then_get r increments r and returns its new value, think ++ r
- Since: 0.17
val get_then_incr : int t ‑> intget_then_incr r increments r and returns its old value, think r++
- Since: 0.17
val to_list : 'a t ‑> 'a list
\ No newline at end of file
+CCRef (containers.CCRef) Module CCRef
References
- Since: 0.9
val incr_then_get : int t ‑> intincr_then_get r increments r and returns its new value, think ++ r.
- Since: 0.17
val get_then_incr : int t ‑> intget_then_incr r increments r and returns its old value, think r++.
- Since: 0.17
val to_list : 'a t ‑> 'a list
\ No newline at end of file
diff --git a/2.0/containers/CCResult/Infix/index.html b/2.0/containers/CCResult/Infix/index.html
index 23fa8f63..a6636cf7 100644
--- a/2.0/containers/CCResult/Infix/index.html
+++ b/2.0/containers/CCResult/Infix/index.html
@@ -1,2 +1,5 @@
-Infix (containers.CCResult.Infix) Module CCResult.Infix
\ No newline at end of file
+Infix (containers.CCResult.Infix) Module CCResult.Infix
a <*> b evaluates a and b, and, in case of success, returns
+Ok (a b). Otherwise, it fails, and the error of a is chosen
+over the error of b if both fail.
\ No newline at end of file
diff --git a/2.0/containers/CCResult/Traverse/argument-1-M/index.html b/2.0/containers/CCResult/Traverse/argument-1-M/index.html
index 9c64ef4b..63ae4079 100644
--- a/2.0/containers/CCResult/Traverse/argument-1-M/index.html
+++ b/2.0/containers/CCResult/Traverse/argument-1-M/index.html
@@ -1,2 +1,2 @@
-1-M (containers.CCResult.Traverse.1-M) Parameter CCResult.Traverse.1-M
val return : 'a ‑> 'a t
\ No newline at end of file
+1-M (containers.CCResult.Traverse.1-M) Parameter CCResult.Traverse.1-M
\ No newline at end of file
diff --git a/2.0/containers/CCResult/index.html b/2.0/containers/CCResult/index.html
index b5f7f7b0..157a29f6 100644
--- a/2.0/containers/CCResult/index.html
+++ b/2.0/containers/CCResult/index.html
@@ -1,21 +1,22 @@
-CCResult (containers.CCResult) Module CCResult
Error Monad
Uses the new "result" type from OCaml 4.03.
- Since: 0.16
Basics
- Since: 1.5
val of_exn_trace : exn ‑> ('a, string) tof_exn_trace e is similar to of_exn e, but it adds the stacktrace
+
CCResult (containers.CCResult) Module CCResult
Error Monad
Uses the new "result" type from OCaml 4.03.
- Since: 0.16
Basics
- Since: 1.5
val of_exn_trace : exn ‑> ('a, string) tof_exn_trace e is similar to of_exn e, but it adds the stacktrace
to the error message.
Remember to call Printexc.record_backtrace true and compile with the
debug flag for this to work.
val fail_printf : ('a, Buffer.t, unit, ('b, string) t) Pervasives.format4 ‑> 'afail_printf format uses format to obtain an error message
-and then returns Error msg
val fail_fprintf : ('a, Format.formatter, unit, ('b, string) t) Pervasives.format4 ‑> 'afail_printf format uses format to obtain an error message
-and then returns Error msg
val fail_fprintf : ('a, Format.formatter, unit, ('b, string) t) Pervasives.format4 ‑> 'afail_fprintf format uses format to obtain an error message
+and then returns Error msg.
add_ctx msg leaves Ok x untouched, but transforms
Error s into Error s' where s' contains the additional
-context given by msg
- Since: 1.2
val add_ctxf : ('a, Format.formatter, unit, ('b, string) t ‑> ('b, string) t) Pervasives.format4 ‑> 'aadd_ctxf format_message is similar to add_ctx but with
+context given by msg.
- Since: 1.2
val add_ctxf : ('a, Format.formatter, unit, ('b, string) t ‑> ('b, string) t) Pervasives.format4 ‑> 'aadd_ctxf format_message is similar to add_ctx but with
Format for printing the message (eagerly).
-Example:
add_ctxf "message(number %d, foo: %B)" 42 true (Error "error)"
- Since: 1.2
Same as map, but also with a function that can transform
-the error message in case of failure
val get_exn : ('a, _) t ‑> 'aExtract the value x from Ok x, fails otherwise.
+Example:
add_ctxf "message(number %d, foo: %B)" 42 true (Error "error)"
- Since: 1.2
Like map, but also with a function that can transform
+the error message in case of failure.
val get_exn : ('a, _) t ‑> 'aExtract the value x from Ok x, fails otherwise.
You should be careful with this function, and favor other combinators
-whenever possible.
- Raises Get_error: if the value is an error.
val get_or : ('a, _) t ‑> default:'a ‑> 'aget_or e ~default returns x if e = Ok x, default otherwise
val map_or : ('a ‑> 'b) ‑> ('a, 'c) t ‑> default:'b ‑> 'bmap_or f e ~default returns f x if e = Ok x, default otherwise
val catch : ('a, 'err) t ‑> ok:('a ‑> 'b) ‑> err:('err ‑> 'b) ‑> 'bcatch e ~ok ~err calls either ok or err depending on
-the value of e.
val fold : ok:('a ‑> 'b) ‑> error:('err ‑> 'b) ‑> ('a, 'err) t ‑> 'bfold ~ok ~error e opens e and, if e = Ok x, returns
+whenever possible.
- Raises Get_error: if the value is an error.
val get_or : ('a, _) t ‑> default:'a ‑> 'aget_or e ~default returns x if e = Ok x, default otherwise.
val map_or : ('a ‑> 'b) ‑> ('a, 'c) t ‑> default:'b ‑> 'bmap_or f e ~default returns f x if e = Ok x, default otherwise.
val catch : ('a, 'err) t ‑> ok:('a ‑> 'b) ‑> err:('err ‑> 'b) ‑> 'bcatch e ~ok ~err calls either ok or err depending on
+the value of e.
val fold : ok:('a ‑> 'b) ‑> error:('err ‑> 'b) ‑> ('a, 'err) t ‑> 'bfold ~ok ~error e opens e and, if e = Ok x, returns
ok x, otherwise e = Error s and it returns error s.
val fold_ok : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> ('b, _) t ‑> 'afold_ok f acc r will compute f acc x if r=Ok x,
-and return acc otherwise, as if the result were a mere option.
- Since: 1.2
Wrappers
val guard : (unit ‑> 'a) ‑> ('a, exn) tguard f runs f () and returns its result wrapped in Ok. If
-f () raises some exception e, then it fails with Error e
val guard_str_trace : (unit ‑> 'a) ‑> ('a, string) tSame as guard_str but uses of_exn_trace instead of of_exn so
-that the stack trace is printed.
val wrap2 : ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> ('c, exn) tSame as guard but gives the function two arguments.
val wrap3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a ‑> 'b ‑> 'c ‑> ('d, exn) tSame as guard but gives the function three arguments.
Applicative
a <*> b evaluates a and b, and, in case of success, returns
+and return acc otherwise, as if the result were a mere option.
- Since: 1.2
Wrappers
val guard : (unit ‑> 'a) ‑> ('a, exn) tguard f runs f () and returns its result wrapped in Ok. If
+f () raises some exception e, then it fails with Error e.
val guard_str_trace : (unit ‑> 'a) ‑> ('a, string) tLike guard_str but uses of_exn_trace instead of of_exn so
+that the stack trace is printed.
val wrap2 : ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> ('c, exn) tLike guard but gives the function two arguments.
val wrap3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a ‑> 'b ‑> 'c ‑> ('d, exn) tLike guard but gives the function three arguments.
Applicative
a <*> b evaluates a and b, and, in case of success, returns
Ok (a b). Otherwise, it fails, and the error of a is chosen
over the error of b if both fail.
join t, in case of success, returns Ok o from Ok (Ok o). Otherwise,
it fails with Error e where e is the unwrapped error of t.
both a b, in case of success, returns Ok (o, o') with the ok values
@@ -23,4 +24,4 @@ of a and b. Otherwise, it fa
error of b if both fail.
Infix
module Infix : sig ... endCollections
Misc
choose l selects a member of l that is a Ok _ value,
or returns Error l otherwise, where l is the list of errors.
retry n f calls f at most n times, returning the first result
of f () that doesn't fail. If f fails n times, retry n f fails
-with the list of successive errors.
Conversions
val to_opt : ('a, _) t ‑> 'a optionval of_opt : 'a option ‑> ('a, string) tIO
\ No newline at end of file
+with the list of successive errors.Conversions
IO
\ No newline at end of file
diff --git a/2.0/containers/CCResult/module-type-MONAD/index.html b/2.0/containers/CCResult/module-type-MONAD/index.html
index 76619ffd..95d076f3 100644
--- a/2.0/containers/CCResult/module-type-MONAD/index.html
+++ b/2.0/containers/CCResult/module-type-MONAD/index.html
@@ -1,2 +1,2 @@
-MONAD (containers.CCResult.MONAD) Module type CCResult.MONAD
Monadic Operations
val return : 'a ‑> 'a t
\ No newline at end of file
+MONAD (containers.CCResult.MONAD) Module type CCResult.MONAD
Monadic Operations
\ No newline at end of file
diff --git a/2.0/containers/CCSet/module-type-S/index.html b/2.0/containers/CCSet/module-type-S/index.html
index a8bf1e1d..05f676c5 100644
--- a/2.0/containers/CCSet/module-type-S/index.html
+++ b/2.0/containers/CCSet/module-type-S/index.html
@@ -1,3 +1,3 @@
-S (containers.CCSet.S) Module type CCSet.S
\ No newline at end of file
+S (containers.CCSet.S) Module type CCSet.S
\ No newline at end of file
diff --git a/2.0/containers/CCString/Sub/index.html b/2.0/containers/CCString/Sub/index.html
index 7803eca4..4ff08d6a 100644
--- a/2.0/containers/CCString/Sub/index.html
+++ b/2.0/containers/CCString/Sub/index.html
@@ -1,4 +1,4 @@
-Sub (containers.CCString.Sub) Module CCString.Sub
val make : string ‑> int ‑> len:int ‑> tval underlying : t ‑> stringval get : t ‑> int ‑> charget s i gets the i-th element, or fails.
- Raises Invalid_argument: if the index is not within
0 ... length - 1. - Since: 1.2
include S with type t := t
val length : t ‑> intval blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unitSimilar to String.blit.
-Compatible with the -safe-string option.
- Raises Invalid_argument: if indices are not valid.
Conversions
val to_list : t ‑> char listval pp : Format.formatter ‑> t ‑> unitPrint the string within quotes.
+
Sub (containers.CCString.Sub) Module CCString.Sub
val make : string ‑> int ‑> len:int ‑> tval underlying : t ‑> stringval get : t ‑> int ‑> charget s i gets the i-th element, or fails.
- Raises Invalid_argument: if the index is not within
0 ... length - 1. - Since: 1.2
\ No newline at end of file
diff --git a/2.0/containers/CCString/index.html b/2.0/containers/CCString/index.html
index c31129be..a9e0a808 100644
--- a/2.0/containers/CCString/index.html
+++ b/2.0/containers/CCString/index.html
@@ -1,8 +1,8 @@
CCString (containers.CCString) Module CCString
Basic String Utils
Consider using Containers_string.KMP for pattern search, or Regex
-libraries.
Common Signature
module type S : sig ... endStrings
include module type of String
val pad : ?side:[ `Left | `Right ] ‑> ?c:char ‑> int ‑> string ‑> stringpad n str ensures that str is at least n bytes long,
-and pads it on the side with c if it's not the case.
- Parameter side: determines where padding occurs (default:
`Left). - Parameter c: the char used to pad (default: ' ').
- Since: 0.17
val of_gen : char gen ‑> stringval of_seq : char sequence ‑> stringval of_klist : char klist ‑> stringval find : ?start:int ‑> sub:string ‑> string ‑> intFind sub in string, returns its first index or -1.
val find_all : ?start:int ‑> sub:string ‑> string ‑> int genfind_all ~sub s finds all occurrences of sub in s, even overlapping
-instances.
- Parameter start: starting position in
s. - Since: 0.17
val find_all_l : ?start:int ‑> sub:string ‑> string ‑> int listfind_all ~sub s finds all occurrences of sub in s and returns
+libraries.
Common Signature
module type S : sig ... endStrings
include module type of String
val is_empty : string ‑> boolis_empty s returns true iff s is empty (i.e. its length is 0).
- Since: 1.5
val pad : ?side:[ `Left | `Right ] ‑> ?c:char ‑> int ‑> string ‑> stringpad n str ensures that str is at least n bytes long,
+and pads it on the side with c if it's not the case.
- Parameter side: determines where padding occurs (default:
`Left). - Parameter c: the char used to pad (default: ' ').
- Since: 0.17
val find : ?start:int ‑> sub:string ‑> string ‑> intFind sub in string, returns its first index or -1.
val find_all : ?start:int ‑> sub:string ‑> string ‑> int genfind_all ~sub s finds all occurrences of sub in s, even overlapping
+instances.
- Parameter start: starting position in
s. - Since: 0.17
val find_all_l : ?start:int ‑> sub:string ‑> string ‑> int listfind_all_l ~sub s finds all occurrences of sub in s and returns
them in a list.
- Parameter start: starting position in
s. - Since: 0.17
val mem : ?start:int ‑> sub:string ‑> string ‑> boolmem ~sub s is true iff sub is a substring of s.
- Since: 0.12
val rfind : sub:string ‑> string ‑> intFind sub in string from the right, returns its first index or -1.
Should only be used with very small sub.
- Since: 0.12
val replace : ?which:[ `Left | `Right | `All ] ‑> sub:string ‑> by:string ‑> string ‑> stringreplace ~sub ~by s replaces some occurrences of sub by by in s.
Parameter which: decides whether the occurrences to replace are:
`Left first occurrence from the left (beginning)`Right first occurrence from the right (end)`All all occurrences (default)
- Raises Invalid_argument: if
sub = "". - Since: 0.14
val is_sub : sub:string ‑> int ‑> string ‑> int ‑> len:int ‑> boolis_sub ~sub i s j ~len returns true iff the substring of
@@ -10,8 +10,10 @@ Should only be used with very small sub.
s starting at position j.
val suffix : suf:string ‑> string ‑> boolsuffix ~suf s returns true iff suf is a suffix of s.
- Since: 0.7
val chop_prefix : pre:string ‑> string ‑> string optionchop_prefix ~pre s removes pre from s if pre really is a prefix
of s, returns None otherwise.
- Since: 0.17
val chop_suffix : suf:string ‑> string ‑> string optionchop_suffix ~suf s removes suf from s if suf really is a suffix
of s, returns None otherwise.
- Since: 0.17
val lines : string ‑> string listlines s returns a list of the lines of s (splits along '\n').
- Since: 0.10
val lines_gen : string ‑> string genlines_gen s returns a generator of the lines of s (splits along '\n').
- Since: 0.10
val concat_gen : sep:string ‑> string gen ‑> stringconcat_gen ~sep g concatenates all strings of g, separated with sep.
- Since: 0.10
val unlines : string list ‑> stringunlines l concatenates all strings of l, separated with '\n'.
- Since: 0.10
val unlines_gen : string gen ‑> stringunlines_gen g concatenates all strings of g, separated with '\n'.
- Since: 0.10
val set : string ‑> int ‑> char ‑> stringset s i c creates a new string which is a copy of s, except
-for index i, which becomes c.
- Raises Invalid_argument: if
i is an invalid index. - Since: 0.12
val flat_map : ?sep:string ‑> (char ‑> string) ‑> string ‑> stringMap each chars to a string, then concatenates them all.
- Parameter sep: optional separator between each generated string.
- Since: 0.12
include S with type S.t := string
val length : t ‑> intval blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unitSimilar to String.blit.
-Compatible with the -safe-string option.
- Raises Invalid_argument: if indices are not valid.
Conversions
val to_list : t ‑> char listval pp : Format.formatter ‑> t ‑> unitPrint the string within quotes.
+for index i, which becomes c.
- Raises Invalid_argument: if
i is an invalid index. - Since: 0.12
val filter_map : (char ‑> char option) ‑> string ‑> stringfilter_map f s calls (f a0) (f a1) ... (f an) where a0 ... an are the characters of s.
+It returns the string of characters ci such as f ai = Some ci (when f returns None,
+the corresponding element of s is discarded).
- Since: 0.17
val filter : (char ‑> bool) ‑> string ‑> stringfilter f s discards characters not satisfying f.
- Since: 0.17
val flat_map : ?sep:string ‑> (char ‑> string) ‑> string ‑> stringMap each chars to a string, then concatenates them all.
- Parameter sep: optional separator between each generated string.
- Since: 0.12
Operations on 2 strings
val map2 : (char ‑> char ‑> char) ‑> string ‑> string ‑> stringMap pairs of chars.
- Raises Invalid_argument: if the strings have not the same length.
- Since: 0.12
val iter2 : (char ‑> char ‑> unit) ‑> string ‑> string ‑> unitIterate on pairs of chars.
- Raises Invalid_argument: if the strings have not the same length.
- Since: 0.12
val iteri2 : (int ‑> char ‑> char ‑> unit) ‑> string ‑> string ‑> unitIterate on pairs of chars with their index.
- Raises Invalid_argument: if the strings have not the same length.
- Since: 0.12
val fold2 : ('a ‑> char ‑> char ‑> 'a) ‑> 'a ‑> string ‑> string ‑> 'aFold on pairs of chars.
- Raises Invalid_argument: if the strings have not the same length.
- Since: 0.12
val for_all2 : (char ‑> char ‑> bool) ‑> string ‑> string ‑> boolAll pairs of chars respect the predicate?
- Raises Invalid_argument: if the strings have not the same length.
- Since: 0.12
val exists2 : (char ‑> char ‑> bool) ‑> string ‑> string ‑> boolExists a pair of chars?
- Raises Invalid_argument: if the strings have not the same length.
- Since: 0.12
Ascii functions
Those functions are deprecated in String since 4.03, so we provide
a stable alias for them even in older versions.
val equal_caseless : string ‑> string ‑> boolComparison without respect to ascii lowercase.
- Since: 1.2
Finding
A relatively efficient algorithm for finding sub-strings.
- Since: 1.0
module Find : sig ... endSplitting
module Split : sig ... endUtils
val compare_versions : string ‑> string ‑> intcompare_versions a b compares version stringsa and b,
considering that numbers are above text.
- Since: 0.13
val compare_natural : string ‑> string ‑> intNatural Sort Order, comparing chunks of digits as natural numbers.
diff --git a/2.0/containers/CCString/module-type-S/index.html b/2.0/containers/CCString/module-type-S/index.html
index 699f9a15..72b58e55 100644
--- a/2.0/containers/CCString/module-type-S/index.html
+++ b/2.0/containers/CCString/module-type-S/index.html
@@ -1,4 +1,4 @@
-
S (containers.CCString.S) Module type CCString.S
val length : t ‑> intval blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unitSimilar to String.blit.
-Compatible with the -safe-string option.
- Raises Invalid_argument: if indices are not valid.
Conversions
val to_list : t ‑> char listval pp : Format.formatter ‑> t ‑> unitPrint the string within quotes.
+
S (containers.CCString.S) Module type CCString.S
val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unitSimilar to String.blit.
+Compatible with the -safe-string option.
- Raises Invalid_argument: if indices are not valid.
Conversions
\ No newline at end of file
diff --git a/2.0/containers/CCVector/index.html b/2.0/containers/CCVector/index.html
index c1753082..9ce4cf5a 100644
--- a/2.0/containers/CCVector/index.html
+++ b/2.0/containers/CCVector/index.html
@@ -1,23 +1,23 @@
-CCVector (containers.CCVector) Module CCVector
Growable, mutable vector
Mutability is rw (read-write) or ro (read-only)
Create a new vector, using the given value as a filler.
- Parameter capacity: the size of the underlying array
-caution: the value will likely not be GC'd before the vector is.
Hint to the vector that it should have at least the given capacity.
- Parameter init: if
capacity v = 0, used as a filler
-element for the underlying array (see create_with) - Since: 0.14
Hint to the vector that it should have at least the given capacity.
+
CCVector (containers.CCVector) Module CCVector
Growable, mutable vector
Mutability is rw (read-write) or ro (read-only).
Create a new vector, using the given value as a filler.
- Parameter capacity: the size of the underlying array.
+caution: the value will likely not be GC'd before the vector is.
Hint to the vector that it should have at least the given capacity.
- Parameter init: if
capacity v = 0, used as a filler
+element for the underlying array (see create_with). - Since: 0.14
Hint to the vector that it should have at least the given capacity.
Just a hint, will not be enforced if the vector is empty and init
-is not provided.
Shrink to the given size (remove elements above this size).
Does nothing if the parameter is bigger than the current size.
Sort the vector, returning a copy of it that is sorted
w.r.t the given ordering. The vector itself is unchanged.
Filter elements from the vector. filter p v leaves v unchanged but
-returns a new vector that only contains elements of v satisfying p.
val exists : ('a ‑> bool) ‑> ('a, _) t ‑> boolExistential test (is there an element that satisfies the predicate?)
val for_all : ('a ‑> bool) ‑> ('a, _) t ‑> boolUniversal test (do all the elements satisfy the predicate?)
val find_exn : ('a ‑> bool) ‑> ('a, _) t ‑> 'aFind an element that satisfies the predicate, or
- Raises Not_found: if no element does
val find_map : ('a ‑> 'b option) ‑> ('a, _) t ‑> 'b optionfind_map f v returns the first Some y = f x for x in v,
-or None if f x = None for each x in v
- Since: 0.14
Filter elements from the vector. filter p v leaves v unchanged but
+returns a new vector that only contains elements of v satisfying p.
val exists : ('a ‑> bool) ‑> ('a, _) t ‑> boolExistential test (is there an element that satisfies the predicate?).
val for_all : ('a ‑> bool) ‑> ('a, _) t ‑> boolUniversal test (do all the elements satisfy the predicate?).
val find_exn : ('a ‑> bool) ‑> ('a, _) t ‑> 'aFind an element that satisfies the predicate, or
- Raises Not_found: if no element does.
val find_map : ('a ‑> 'b option) ‑> ('a, _) t ‑> 'b optionfind_map f v returns the first Some y = f x for x in v,
+or None if f x = None for each x in v.
- Since: 0.14
Like flat_map, but using list for
-intermediate collections.
- Since: 0.14
val get : ('a, _) t ‑> int ‑> 'aAccess element by its index, or
- Raises Invalid_argument: if bad index
Remove the n-th element of the vector. Does NOT preserve the order
-of the elements (might swap with the last element)
val rev_iter : ('a ‑> unit) ‑> ('a, _) t ‑> unitrev_iter f a is the same as iter f (rev a), only more efficient.
- Since: 0.14
val get : ('a, _) t ‑> int ‑> 'aAccess element by its index, or
- Raises Invalid_argument: if bad index.
Remove the n-th element of the vector. Does NOT preserve the order
+of the elements (might swap with the last element).
val rev_iter : ('a ‑> unit) ‑> ('a, _) t ‑> unitrev_iter f a is the same as iter f (rev a), only more efficient.
- Since: 0.14
Access the underlying shared array (do not modify!).
unsafe_get_array v is longer than size v, but elements at higher
index than size v are undefined (do not access!).
val (--) : int ‑> int ‑> (int, 'mut) tRange of integers, either ascending or descending (both included,
therefore the result is never empty).
-Example: 1 -- 10 returns the vector [1;2;3;4;5;6;7;8;9;10]
val (--^) : int ‑> int ‑> (int, 'mut) tRange of integers, either ascending or descending, but excluding right.,
-Example: 1 --^ 10 returns the vector [1;2;3;4;5;6;7;8;9]
- Since: 0.17
val of_array : 'a array ‑> ('a, 'mut) tval of_list : 'a list ‑> ('a, 'mut) tval to_array : ('a, _) t ‑> 'a arrayval to_list : ('a, _) t ‑> 'a listto_seq_rev v returns the sequence of elements of v in reverse order,
+Example: 1 -- 10 returns the vector [1;2;3;4;5;6;7;8;9;10].
val (--^) : int ‑> int ‑> (int, 'mut) tRange of integers, either ascending or descending, but excluding right.
+Example: 1 --^ 10 returns the vector [1;2;3;4;5;6;7;8;9].
- Since: 0.17
val of_list : 'a list ‑> ('a, 'mut) tto_seq_rev v returns the sequence of elements of v in reverse order,
that is, the last elements of v are iterated on first.
- Since: 0.14
\ No newline at end of file
diff --git a/2.0/containers/Containers/Hashtbl/index.html b/2.0/containers/Containers/Hashtbl/index.html
index c282298f..3a9eaab3 100644
--- a/2.0/containers/Containers/Hashtbl/index.html
+++ b/2.0/containers/Containers/Hashtbl/index.html
@@ -1,20 +1,20 @@
-Hashtbl (containers.Containers.Hashtbl) Module Containers.Hashtbl
- Since: 0.14
include module type of Hashtbl with type Hashtbl.statistics = Hashtbl.statistics and module Hashtbl.Make = Hashtbl.Make and type ('a, 'b) Hashtbl.t = ('a, 'b) Hashtbl.t
val create : ?random:bool ‑> int ‑> ('a, 'b) tval clear : ('a, 'b) t ‑> unitval reset : ('a, 'b) t ‑> unitval add : ('a, 'b) t ‑> 'a ‑> 'b ‑> unitval find : ('a, 'b) t ‑> 'a ‑> 'bval find_opt : ('a, 'b) t ‑> 'a ‑> 'b optionval find_all : ('a, 'b) t ‑> 'a ‑> 'b listval mem : ('a, 'b) t ‑> 'a ‑> boolval remove : ('a, 'b) t ‑> 'a ‑> unitval replace : ('a, 'b) t ‑> 'a ‑> 'b ‑> unitval iter : ('a ‑> 'b ‑> unit) ‑> ('a, 'b) t ‑> unitval filter_map_inplace : ('a ‑> 'b ‑> 'b option) ‑> ('a, 'b) t ‑> unitval fold : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> ('a, 'b) t ‑> 'c ‑> 'cval length : ('a, 'b) t ‑> intval stats : ('a, 'b) t ‑> statisticsmodule type HashedType : sig ... endmodule type S : sig ... endmodule type SeededHashedType : sig ... endmodule type SeededS : sig ... endmodule MakeSeeded : functor (H : SeededHashedType) -> sig ... endinclude CCHashtbl.Poly
val get_or : ('a, 'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'bget_or tbl k ~default returns the value associated to k if present,
-and returns default otherwise (if k doesn't belong in tbl)
- Since: 0.16
val keys : ('a, 'b) Hashtbl.t ‑> 'a CCHashtbl.sequenceIterate on keys (similar order as Hashtbl.iter)
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a, 'b) Hashtbl.t ‑> 'c listMap on a hashtable's items, collect into a list
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitincr ?by tbl x increments or initializes the counter associated with x.
+
Hashtbl (containers.Containers.Hashtbl) Module Containers.Hashtbl
- Since: 0.14
include module type of Hashtbl with type Hashtbl.statistics = Hashtbl.statistics and module Hashtbl.Make = Hashtbl.Make and type ('a, 'b) Hashtbl.t = ('a, 'b) Hashtbl.t
val create : ?random:bool ‑> int ‑> ('a, 'b) tval clear : ('a, 'b) t ‑> unitval reset : ('a, 'b) t ‑> unitval add : ('a, 'b) t ‑> 'a ‑> 'b ‑> unitval find : ('a, 'b) t ‑> 'a ‑> 'bval find_opt : ('a, 'b) t ‑> 'a ‑> 'b optionval find_all : ('a, 'b) t ‑> 'a ‑> 'b listval mem : ('a, 'b) t ‑> 'a ‑> boolval remove : ('a, 'b) t ‑> 'a ‑> unitval replace : ('a, 'b) t ‑> 'a ‑> 'b ‑> unitval iter : ('a ‑> 'b ‑> unit) ‑> ('a, 'b) t ‑> unitval filter_map_inplace : ('a ‑> 'b ‑> 'b option) ‑> ('a, 'b) t ‑> unitval fold : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> ('a, 'b) t ‑> 'c ‑> 'cval length : ('a, 'b) t ‑> intval stats : ('a, 'b) t ‑> statisticsmodule type HashedType : sig ... endmodule type S : sig ... endmodule type SeededHashedType : sig ... endmodule type SeededS : sig ... endmodule MakeSeeded : functor (H : SeededHashedType) -> sig ... endinclude CCHashtbl.Poly
val get_or : ('a, 'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'bget_or tbl k ~default returns the value associated to k if present,
+and returns default otherwise (if k doesn't belong in tbl).
- Since: 0.16
val keys : ('a, 'b) Hashtbl.t ‑> 'a CCHashtbl.sequenceIterate on keys (similar order as Hashtbl.iter).
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a, 'b) Hashtbl.t ‑> 'c listMap on a hashtable's items, collect into a list.
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitincr ?by tbl x increments or initializes the counter associated with x.
If get tbl x = None, then after update, get tbl x = Some 1;
-otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1 - Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitSame as incr but substract 1 (or the value of by).
+otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1. - Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unitLike incr but subtract 1 (or the value of by).
If the value reaches 0, the key is removed from the table.
-This does nothing if the key is not already present in the table.
- Since: 0.16
val add_list : ('a, 'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unitadd_list tbl x y adds y to the list x is bound to. If x is
-not bound, it becomes bound to [y].
- Since: 0.16
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val of_seq : ('a * 'b) CCHashtbl.sequence ‑> ('a, 'b) Hashtbl.tFrom the given bindings, added in order
val add_seq_count : ('a, int) Hashtbl.t ‑> 'a CCHashtbl.sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
+This does nothing if the key is not already present in the table.
- Since: 0.16
val add_list : ('a, 'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unitadd_list tbl x y adds y to the list x is bound to. If x is
+not bound, it becomes bound to y.
- Since: 0.16
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val of_seq : ('a * 'b) CCHashtbl.sequence ‑> ('a, 'b) Hashtbl.tFrom the given bindings, added in order.
val add_seq_count : ('a, int) Hashtbl.t ‑> 'a CCHashtbl.sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
by calling incr. This is useful for counting how many times each
-element of seq occurs.
- Since: 0.16
val of_seq_count : 'a CCHashtbl.sequence ‑> ('a, int) Hashtbl.tSimilar to add_seq_count, but allocates a new table and returns it
- Since: 0.16
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.tBuild a table from the given list of bindings k_i -> v_i,
+element of seq occurs.
- Since: 0.16
val of_seq_count : 'a CCHashtbl.sequence ‑> ('a, int) Hashtbl.tSimilar to add_seq_count, but allocates a new table and returns it.
- Since: 0.16
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.tBuild a table from the given list of bindings k_i -> v_i,
added in order using add. If a key occurs several times,
it will be added several times, and the visible binding
will be the last one.
val update : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unitupdate tbl ~f ~k updates key k by calling f k (Some v) if
k was mapped to v, or f k None otherwise; if the call
returns None then k is removed/stays removed, if the call
returns Some v' then the binding k -> v' is inserted
-using Hashtbl.replace
- Since: 0.14
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'bget_or_add tbl ~k ~f finds and returns the binding of k
+using Hashtbl.replace.
- Since: 0.14
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'bget_or_add tbl ~k ~f finds and returns the binding of k
in tbl, if it exists. If it does not exist, then f k
is called to obtain a new binding v; k -> v is added
to tbl and v is returned.
- Since: 1.0
val pp : 'a CCHashtbl.printer ‑> 'b CCHashtbl.printer ‑> ('a, 'b) Hashtbl.t CCHashtbl.printermodule type S' = CCHashtbl.Smodule Make' = CCHashtbl.Make
\ No newline at end of file
diff --git a/2.0/containers/Containers/Hashtbl/module-type-S'/index.html b/2.0/containers/Containers/Hashtbl/module-type-S'/index.html
index 9ea39c31..8aa1da85 100644
--- a/2.0/containers/Containers/Hashtbl/module-type-S'/index.html
+++ b/2.0/containers/Containers/Hashtbl/module-type-S'/index.html
@@ -1,20 +1,20 @@
-S' (containers.Containers.Hashtbl.S') Module type Containers.Hashtbl.S'
get_or tbl k ~default returns the value associated to k if present,
-and returns default otherwise (if k doesn't belong in tbl)
- Since: 0.16
add_list tbl x y adds y to the list x is bound to. If x is
-not bound, it becomes bound to [y].
- Since: 0.16
incr ?by tbl x increments or initializes the counter associated with x.
+
S' (containers.Containers.Hashtbl.S') Module type Containers.Hashtbl.S'
get_or tbl k ~default returns the value associated to k if present,
+and returns default otherwise (if k doesn't belong in tbl).
- Since: 0.16
add_list tbl x y adds y to the list x is bound to. If x is
+not bound, it becomes bound to y.
- Since: 0.16
incr ?by tbl x increments or initializes the counter associated with x.
If get tbl x = None, then after update, get tbl x = Some 1;
-otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1 - Since: 0.16
Same as incr but substract 1 (or the value of by).
+otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).
- Parameter by: if specified, the int value is incremented by
by rather than 1. - Since: 0.16
Like incr but subtract 1 (or the value of by).
If the value reaches 0, the key is removed from the table.
-This does nothing if the key is not already present in the table.
- Since: 0.16
val add_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val add_seq_count : int t ‑> key CCHashtbl.sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
+This does nothing if the key is not already present in the table.
- Since: 0.16
val add_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence ‑> unitAdd the corresponding pairs to the table, using Hashtbl.add.
- Since: 0.16
val add_seq_count : int t ‑> key CCHashtbl.sequence ‑> unitadd_seq_count tbl seq increments the count of each element of seq
by calling incr. This is useful for counting how many times each
-element of seq occurs.
- Since: 0.16
val of_seq_count : key CCHashtbl.sequence ‑> int tSimilar to add_seq_count, but allocates a new table and returns it
- Since: 0.16
val of_seq_count : key CCHashtbl.sequence ‑> int tSimilar to add_seq_count, but allocates a new table and returns it.
- Since: 0.16
Build a table from the given list of bindings k_i -> v_i,
added in order using add. If a key occurs several times,
it will be added several times, and the visible binding
will be the last one.
update tbl ~f ~k updates key k by calling f k (Some v) if
k was mapped to v, or f k None otherwise; if the call
returns None then k is removed/stays removed, if the call
returns Some v' then the binding k -> v' is inserted
-using Hashtbl.replace
- Since: 0.14
get_or_add tbl ~k ~f finds and returns the binding of k
+using Hashtbl.replace.
- Since: 0.14
get_or_add tbl ~k ~f finds and returns the binding of k
in tbl, if it exists. If it does not exist, then f k
is called to obtain a new binding v; k -> v is added
to tbl and v is returned.
- Since: 1.0
val pp : key CCHashtbl.printer ‑> 'a CCHashtbl.printer ‑> 'a t CCHashtbl.printer
\ No newline at end of file
diff --git a/2.0/index.html b/2.0/index.html
index 8f11d831..a8eb8664 100644
--- a/2.0/index.html
+++ b/2.0/index.html
@@ -10,14 +10,14 @@
OCaml package documentation
- - containers 2.0+alpha1
- - containers.data 2.0+alpha1
- - containers.iter 2.0+alpha1
- - containers.monomorphic 2.0+alpha1
- - containers.sexp 2.0+alpha1
- - containers.thread 2.0+alpha1
- - containers.top 2.0+alpha1
- - containers.unix 2.0+alpha1
+ - containers 2.0
+ - containers.data 2.0
+ - containers.iter 2.0
+ - containers.monomorphic 2.0
+ - containers.sexp 2.0
+ - containers.thread 2.0
+ - containers.top 2.0
+ - containers.unix 2.0