diff --git a/dev/containers/CCArray/index.html b/dev/containers/CCArray/index.html index d6a35cef..6fdbe888 100644 --- a/dev/containers/CCArray/index.html +++ b/dev/containers/CCArray/index.html @@ -1,4 +1,4 @@ -
CCArrayArray utils
include module type of struct include Stdlib.Array endval empty : 'a tempty is the empty array, physically equal to [||].
equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.
compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.
val swap : 'a t -> int -> int -> unitswap a i j swaps elements at indices i and j.
val get_safe : 'a t -> int -> 'a optionget_safe a i returns Some a.(i) if i is a valid index.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as Array.fold_left
val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'afoldi f init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.
val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'afold_while f init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map f init a is a fold_left-like function, but it also maps the array to another array.
scan_left f init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .
val reverse_in_place : 'a t -> unitreverse_in_place a reverses the array a in place.
val sorted : ('a -> 'a -> int) -> 'a t -> 'a arraysorted f a makes a copy of a and sorts it with f.
val sort_indices : ('a -> 'a -> int) -> 'a t -> int arraysort_indices f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.
val sort_ranking : ('a -> 'a -> int) -> 'a t -> int arraysort_ranking f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.
In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> boolmem ~eq x a return true if x is present in a. Linear time.
val find_map : ('a -> 'b option) -> 'a t -> 'b optionfind_map f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.
val find_map_i : (int -> 'a -> 'b option) -> 'a t -> 'b optionfind_map_i f a is like find_map, but the index of the element is also passed to the predicate function f.
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) optionfind_idx f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.
lookup ~cmp key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt ~cmp. Complexity: O(log (n)) (dichotomic search).
val bsearch : cmp:('a -> 'a -> int) ->
+CCArray (containers.CCArray) Module CCArray
Array utils
Arrays
include module type of struct include Stdlib.Array end
val empty : 'a tempty is the empty array, physically equal to [||].
equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.
compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.
val swap : 'a t -> int -> int -> unitswap a i j swaps elements at indices i and j.
val get_safe : 'a t -> int -> 'a optionget_safe a i returns Some a.(i) if i is a valid index.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as Array.fold_left
val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'afoldi f init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.
val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'afold_while f init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map f init a is a fold_left-like function, but it also maps the array to another array.
scan_left f init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .
val reverse_in_place : 'a t -> unitreverse_in_place a reverses the array a in place.
val sorted : ('a -> 'a -> int) -> 'a t -> 'a arraysorted f a makes a copy of a and sorts it with f.
val sort_indices : ('a -> 'a -> int) -> 'a t -> int arraysort_indices f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.
val sort_ranking : ('a -> 'a -> int) -> 'a t -> int arraysort_ranking f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.
In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> boolmem ~eq x a return true if x is present in a. Linear time.
val find_map : ('a -> 'b option) -> 'a t -> 'b optionfind_map f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.
val find_map_i : (int -> 'a -> 'b option) -> 'a t -> 'b optionfind_map_i f a is like find_map, but the index of the element is also passed to the predicate function f.
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) optionfind_idx f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.
lookup ~cmp key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt ~cmp. Complexity: O(log (n)) (dichotomic search).
val bsearch : cmp:('a -> 'a -> int) ->
'a -> 'a t -> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ~cmp key a finds the index of the object key in the array a, provided a 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 a (dichotomic search).
for_all2 f [|a1; …; an|] [|b1; …; bn|] is true if each pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) && (f a2 b2) && … && (f an bn).
exists2 f [|a1; …; an|] [|b1; …; bn|] is true if any pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) || (f a2 b2) || … || (f an bn).
fold2 f init a b fold on two arrays a and b stepwise. It computes f (… (f init a1 b1) …) an bn.
val shuffle : 'a t -> unitshuffle a randomly shuffles the array a, in place.
val shuffle_with : Stdlib.Random.State.t -> 'a t -> unitshuffle_with rs a randomly shuffles the array a (like shuffle) but a specialized random state rs is used to control the random numbers being produced during shuffling (for reproducibility).
val random_choose : 'a t -> 'a random_genrandom_choose a rs randomly chooses an element of a.
to_string ~sep item_to_string a print a to a string using sep as a separator between elements of a.
to_iter a returns an iter of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the iterator.
val to_seq : 'a t -> 'a Stdlib.Seq.tto_seq a returns a Seq.t of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the sequence. Renamed from to_std_seq since 3.0.
IO
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf a formats the array a on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
val pp_i : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> (int -> 'a printer) -> 'a t printerpp_i ~pp_start ~pp_stop ~pp_sep pp_item ppf a prints the array a on ppf. The printing function pp_item is giving both index and element. pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
filter f a filters elements out of the array a. Only the elements satisfying the given predicate f will be kept.
filter_map f [|a1; …; an|] calls (f a1) … (f an) and returns an array b consisting of all elements bi such as f ai = Some bi. When f returns None, the corresponding element of a is discarded.
monoid_product f a b passes all combinaisons of tuples from the two arrays a and b to the function f.
flat_map f a transforms each element of a into an array, then flattens.
val except_idx : 'a t -> int -> 'a listexcept_idx a i removes the element of a at given index i, and returns 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_genGeneric Functions
module type MONO_ARRAY = sig ... endval sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) -> cmp:('elt -> 'elt -> int)
-> 'arr -> unitsort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.
Infix Operators
It is convenient to openCCArray.Infix to access the infix operators without cluttering the scope too much.
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCArrayLabels/index.html b/dev/containers/CCArrayLabels/index.html
index 4472daaf..979b6a42 100644
--- a/dev/containers/CCArrayLabels/index.html
+++ b/dev/containers/CCArrayLabels/index.html
@@ -1,5 +1,5 @@
CCArrayLabels (containers.CCArrayLabels) Module CCArrayLabels
Array utils (Labeled version of CCArray)
Arrays
include module type of Stdlib.ArrayLabels with module Floatarray = Stdlib.Array.Floatarray
module Floatarray : sig ... endval empty : 'a tempty is the empty array, physically equal to ||.
equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.
compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.
val swap : 'a t -> int -> int -> unitswap a i j swaps elements at indices i and j.
val get_safe : 'a t -> int -> 'a optionget_safe a i returns Some a.(i) if i is a valid index.
val fold : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'afold ~f ~init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as ArrayLabels.fold_left
val foldi : f:('a -> int -> 'b -> 'a) -> init:'a -> 'b t -> 'afoldi ~f ~init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.
val fold_while : f:('a -> 'b -> 'a * [ `Stop | `Continue ]) -> init:'a -> 'b t -> 'afold_while ~f ~init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map ~f ~init a is a fold_left-like function, but it also maps the array to another array.
scan_left ~f ~init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .
val reverse_in_place : 'a t -> unitreverse_in_place a reverses the array a in place.
val sorted : f:('a -> 'a -> int) -> 'a t -> 'a arraysorted ~f a makes a copy of a and sorts it with f.
val sort_indices : f:('a -> 'a -> int) -> 'a t -> int arraysort_indices ~f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.
val sort_ranking : f:('a -> 'a -> int) -> 'a t -> int arraysort_ranking ~f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.
In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> boolmem ~eq x a return true if x is present in a. Linear time.
val find_map : f:('a -> 'b option) -> 'a t -> 'b optionfind_map ~f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.
val find_map_i : f:(int -> 'a -> 'b option) -> 'a t -> 'b optionfind_map_i ~f a is like find_map, but the index of the element is also passed to the predicate function f.
val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) optionfind_idx ~f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.
lookup ~cmp ~key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt cmp. Complexity: O(log (n)) (dichotomic search).
module Floatarray : sig ... endval empty : 'a tempty is the empty array, physically equal to ||.
equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.
compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.
val swap : 'a t -> int -> int -> unitswap a i j swaps elements at indices i and j.
val get_safe : 'a t -> int -> 'a optionget_safe a i returns Some a.(i) if i is a valid index.
val fold : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'afold ~f ~init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as ArrayLabels.fold_left
val foldi : f:('a -> int -> 'b -> 'a) -> init:'a -> 'b t -> 'afoldi ~f ~init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.
val fold_while : f:('a -> 'b -> 'a * [ `Stop | `Continue ]) -> init:'a -> 'b t -> 'afold_while ~f ~init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map ~f ~init a is a fold_left-like function, but it also maps the array to another array.
scan_left ~f ~init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .
val reverse_in_place : 'a t -> unitreverse_in_place a reverses the array a in place.
val sorted : f:('a -> 'a -> int) -> 'a t -> 'a arraysorted ~f a makes a copy of a and sorts it with f.
val sort_indices : f:('a -> 'a -> int) -> 'a t -> int arraysort_indices ~f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.
val sort_ranking : f:('a -> 'a -> int) -> 'a t -> int arraysort_ranking ~f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.
In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> boolmem ~eq x a return true if x is present in a. Linear time.
val find_map : f:('a -> 'b option) -> 'a t -> 'b optionfind_map ~f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.
val find_map_i : f:(int -> 'a -> 'b option) -> 'a t -> 'b optionfind_map_i ~f a is like find_map, but the index of the element is also passed to the predicate function f.
val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) optionfind_idx ~f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.
lookup ~cmp ~key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt cmp. Complexity: O(log (n)) (dichotomic search).
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 a finds the index of the object key in the array a, provided a 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 a (dichotomic search).
for_all2 ~f [|a1; …; an|] [|b1; …; bn|] is true if each pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) && (f a2 b2) && … && (f an bn).
exists2 ~f [|a1; …; an|] [|b1; …; bn|] is true if any pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) || (f a2 b2) || … || (f an bn).
fold2 ~f ~init a b fold on two arrays a and b stepwise. It computes f (… (f init a1 b1) …) an bn.
iter2 ~f a b iterates on the two arrays a and b stepwise. It is equivalent to f a0 b0; …; f a.(length a - 1) b.(length b - 1); ().
val shuffle : 'a t -> unitshuffle a randomly shuffles the array a, in place.
val shuffle_with : Stdlib.Random.State.t -> 'a t -> unitshuffle_with rs a randomly shuffles the array a (like shuffle) but a specialized random state rs is used to control the random numbers being produced during shuffling (for reproducibility).
val random_choose : 'a t -> 'a random_genrandom_choose a rs randomly chooses an element of a.
to_string ~sep item_to_string a print a to a string using sep as a separator between elements of a.
to_iter a returns an iter of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the iterator.
val to_seq : 'a t -> 'a Stdlib.Seq.tto_seq a returns a Seq.t of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the sequence. Renamed from to_std_seq since 3.0.
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf a formats the array a on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
val pp_i : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> (int -> 'a printer) -> 'a t printerpp_i ~pp_start ~pp_stop ~pp_sep pp_item ppf a prints the array a on ppf. The printing function pp_item is giving both index and element. pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
map2 ~f a b applies function f to all 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)|].
filter ~f a filters elements out of the array a. Only the elements satisfying the given predicate f will be kept.
filter_map ~f [|a1; …; an|] calls (f a1) … (f an) and returns an array b consisting of all elements bi such as f ai = Some bi. When f returns None, the corresponding element of a is discarded.
monoid_product ~f a b passes all combinaisons of tuples from the two arrays a and b to the function f.
flat_map ~f a transforms each element of a into an array, then flattens.
val except_idx : 'a t -> int -> 'a listexcept_idx a i removes the element of a at given index i, and returns 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_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.
It is convenient to openCCArray.Infix to access the infix operators without cluttering the scope too much.
module Infix : sig ... endCCAtomicCCAtomicCCFormatHelpers for Format
include module type of struct include Stdlib.Format endval pp_open_box : formatter -> int -> unitval pp_close_box : formatter -> unit -> unitval 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_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_space : formatter -> unit -> unitval pp_print_cut : formatter -> unit -> unitval pp_print_break : formatter -> int -> int -> unitval pp_print_custom_break : formatter -> fits:(string * int * string) ->
-breaks:(string * int * string) -> unitval pp_force_newline : formatter -> unit -> unitval pp_print_if_newline : formatter -> unit -> unitval pp_print_flush : formatter -> unit -> unitval pp_print_newline : formatter -> unit -> unitval 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 check_geometry : geometry -> boolval pp_set_geometry : formatter -> max_indent:int -> margin:int -> unitval pp_safe_set_geometry : formatter -> max_indent:int -> margin:int -> unitval get_geometry : unit -> geometryval pp_set_max_boxes : formatter -> int -> unitval pp_get_max_boxes : formatter -> unit -> intval pp_over_max_boxes : formatter -> unit -> boolval pp_open_tbox : formatter -> unit -> unitval pp_close_tbox : formatter -> unit -> unitval pp_set_tab : formatter -> unit -> unitval pp_print_tab : formatter -> unit -> unitval pp_print_tbreak : formatter -> int -> int -> unitval pp_set_ellipsis_text : formatter -> string -> unitval pp_get_ellipsis_text : formatter -> unit -> stringval open_stag : stag -> unitval pp_close_stag : 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_formatter_out_channel : formatter -> Stdlib.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_out_functions : formatter -> formatter_out_functions -> unitval set_formatter_out_functions : formatter_out_functions -> unitval pp_get_formatter_out_functions : formatter -> unit -> formatter_out_functionsval get_formatter_out_functions : unit -> formatter_out_functionsval pp_set_formatter_stag_functions : formatter -> formatter_stag_functions -> unitval set_formatter_stag_functions : formatter_stag_functions -> unitval pp_get_formatter_stag_functions : formatter -> unit -> formatter_stag_functionsval get_formatter_stag_functions : unit -> formatter_stag_functionsval formatter_of_out_channel : Stdlib.out_channel -> formatterval std_formatter : formatterval err_formatter : formatterval formatter_of_buffer : Stdlib.Buffer.t -> formatterval str_formatter : formatterval make_formatter : (string -> int -> int -> unit) -> (unit -> unit) -> formatterval formatter_of_out_functions : formatter_out_functions -> formatterval make_symbolic_output_buffer : unit -> symbolic_output_bufferval clear_symbolic_output_buffer : symbolic_output_buffer -> unitval get_symbolic_output_buffer : symbolic_output_buffer -> symbolic_output_item listval flush_symbolic_output_buffer : symbolic_output_buffer -> symbolic_output_item listval add_symbolic_output_item : symbolic_output_buffer -> symbolic_output_item -> unitval formatter_of_symbolic_output_buffer : symbolic_output_buffer -> formatterval pp_print_text : formatter -> string -> unitval printf : ('a, formatter, unit) Stdlib.format -> 'aval eprintf : ('a, formatter, unit) Stdlib.format -> 'aval asprintf : ('a, formatter, unit, string) Stdlib.format4 -> 'aval kasprintf : (string -> 'a) -> ('b, formatter, unit, 'a) Stdlib.format4 -> 'bval bprintf : Stdlib.Buffer.t -> ('a, formatter, unit) Stdlib.format -> 'aval set_all_formatter_output_functions : out:(string -> int -> int -> unit) ->
+CCFormat (containers.CCFormat) Module CCFormat
Helpers for Format
include module type of struct include Stdlib.Format end
val pp_open_box : formatter -> int -> unitval pp_close_box : formatter -> unit -> unitval 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_print_string : formatter -> string -> unitval pp_print_bytes : formatter -> bytes -> 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_space : formatter -> unit -> unitval pp_print_cut : formatter -> unit -> unitval pp_print_break : formatter -> int -> int -> unitval pp_print_custom_break : formatter -> fits:(string * int * string) ->
+breaks:(string * int * string) -> unitval pp_force_newline : formatter -> unit -> unitval pp_print_if_newline : formatter -> unit -> unitval pp_print_flush : formatter -> unit -> unitval pp_print_newline : formatter -> unit -> unitval 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 check_geometry : geometry -> boolval pp_set_geometry : formatter -> max_indent:int -> margin:int -> unitval pp_safe_set_geometry : formatter -> max_indent:int -> margin:int -> unitval get_geometry : unit -> geometryval pp_set_max_boxes : formatter -> int -> unitval pp_get_max_boxes : formatter -> unit -> intval pp_over_max_boxes : formatter -> unit -> boolval pp_open_tbox : formatter -> unit -> unitval pp_close_tbox : formatter -> unit -> unitval pp_set_tab : formatter -> unit -> unitval pp_print_tab : formatter -> unit -> unitval pp_print_tbreak : formatter -> int -> int -> unitval pp_set_ellipsis_text : formatter -> string -> unitval pp_get_ellipsis_text : formatter -> unit -> stringval open_stag : stag -> unitval pp_close_stag : 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_formatter_out_channel : formatter -> Stdlib.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_out_functions : formatter -> formatter_out_functions -> unitval set_formatter_out_functions : formatter_out_functions -> unitval pp_get_formatter_out_functions : formatter -> unit -> formatter_out_functionsval get_formatter_out_functions : unit -> formatter_out_functionsval pp_set_formatter_stag_functions : formatter -> formatter_stag_functions -> unitval set_formatter_stag_functions : formatter_stag_functions -> unitval pp_get_formatter_stag_functions : formatter -> unit -> formatter_stag_functionsval get_formatter_stag_functions : unit -> formatter_stag_functionsval formatter_of_out_channel : Stdlib.out_channel -> formatterval std_formatter : formatterval err_formatter : formatterval formatter_of_buffer : Stdlib.Buffer.t -> formatterval str_formatter : formatterval make_formatter : (string -> int -> int -> unit) -> (unit -> unit) -> formatterval formatter_of_out_functions : formatter_out_functions -> formatterval make_symbolic_output_buffer : unit -> symbolic_output_bufferval clear_symbolic_output_buffer : symbolic_output_buffer -> unitval get_symbolic_output_buffer : symbolic_output_buffer -> symbolic_output_item listval flush_symbolic_output_buffer : symbolic_output_buffer -> symbolic_output_item listval add_symbolic_output_item : symbolic_output_buffer -> symbolic_output_item -> unitval formatter_of_symbolic_output_buffer : symbolic_output_buffer -> formatterval pp_print_text : formatter -> string -> unitval printf : ('a, formatter, unit) Stdlib.format -> 'aval eprintf : ('a, formatter, unit) Stdlib.format -> 'aval asprintf : ('a, formatter, unit, string) Stdlib.format4 -> 'aval kasprintf : (string -> 'a) -> ('b, formatter, unit, 'a) Stdlib.format4 -> 'bval bprintf : Stdlib.Buffer.t -> ('a, formatter, unit) Stdlib.format -> 'aval 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 open_tag : tag -> unitval pp_close_tag : formatter -> unit -> unitval pp_set_formatter_tag_functions : formatter -> formatter_tag_functions -> unitval set_formatter_tag_functions : formatter_tag_functions -> unitval pp_get_formatter_tag_functions : formatter -> unit -> formatter_tag_functionsval get_formatter_tag_functions : unit -> formatter_tag_functionstype -'a printer = t -> 'a -> unitCombinators
val silent : 'a printerPrints nothing.
val unit : unit printerPrints "()".
val int : int printerval string : string printerval bool : bool printerval float3 : float printerval float : float printerval exn : exn printerPrinter using Printexc.to_string.
val space : unit printerAlias to pp_print_space.
val cut : unit printerAlias to pp_print_cut.
val break : (int * int) printerTuple-ized printer form of pp_print_break.
val newline : unit printerForce newline (see Format.pp_force_newline).
val substring : (string * int * int) printersubstring (s,i,len) prints the substring (s,i,len), where i is the offset in s and len the number of bytes in the substring.
val text : string printerPrint string, but replacing spaces with breaks and newlines with newline. See pp_print_text on recent versions of OCaml.
val string_lines : string printerstring_lines out s prints s with all newlines ('\n') replaced by a cut, in a vertical box. It does NOT insert breakable spaces in place of spaces, unlike text. This means an already formatted string can be displayed inside another formatter without mangling the indentation.
val char : char printerval int32 : int32 printerval int64 : int64 printerval nativeint : nativeint printerval flush : unit printerAlias to Format.pp_print_flush.
val string_quoted : string printerSimilar to CCString.print.
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.
append ppa ppb first prints ppa (), then prints ppb ().
within a b p wraps p inside the strings a and b. Convenient, for instances, for brackets, parenthesis, quotes, etc.
val return : ('a, _, _, 'a) Stdlib.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 all
val const_string : string -> 'a printerconst_string s is a printer that ignores its input and always prints s.
val opaque : 'a printeropaque is const_string "opaque". The exact string used is not stable.
lazy_force pp out x forces x and prints the result with pp.
lazy_or ?default pp out x prints default if x is not evaluated yet, or uses pp otherwise.
ANSI codes
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:
- "reset" resets style
- "black"
- "red"
- "green"
- "yellow"
- "blue"
- "magenta"
- "cyan"
- "white"
- "bold" bold font
- "Black" bold black
- "Red" bold red
- "Green" bold green
- "Yellow" bold yellow
- "Blue" bold blue
- "Magenta" bold magenta
- "Cyan" bold cyan
- "White" bold white
Example:
set_color_default true;;
+flush:(unit -> unit) -> newline:(unit -> unit) -> spaces:(int -> unit) -> unit
val pp_get_all_formatter_output_functions : formatter -> unit -> (string -> int -> int -> unit) * (unit -> unit) * (unit -> unit) * (int -> unit)val open_tag : tag -> unitval pp_close_tag : formatter -> unit -> unitval pp_set_formatter_tag_functions : formatter -> formatter_tag_functions -> unitval set_formatter_tag_functions : formatter_tag_functions -> unitval pp_get_formatter_tag_functions : formatter -> unit -> formatter_tag_functionsval get_formatter_tag_functions : unit -> formatter_tag_functionstype -'a printer = t -> 'a -> unitval silent : 'a printerPrints nothing.
val unit : unit printerPrints "()".
val int : int printerval string : string printerval bool : bool printerval float3 : float printerval float : float printerval exn : exn printerPrinter using Printexc.to_string.
val space : unit printerAlias to pp_print_space.
val cut : unit printerAlias to pp_print_cut.
val break : (int * int) printerTuple-ized printer form of pp_print_break.
val newline : unit printerForce newline (see Format.pp_force_newline).
val substring : (string * int * int) printersubstring (s,i,len) prints the substring (s,i,len), where i is the offset in s and len the number of bytes in the substring.
val text : string printerPrint string, but replacing spaces with breaks and newlines with newline. See pp_print_text on recent versions of OCaml.
val string_lines : string printerstring_lines out s prints s with all newlines ('\n') replaced by a cut, in a vertical box. It does NOT insert breakable spaces in place of spaces, unlike text. This means an already formatted string can be displayed inside another formatter without mangling the indentation.
val char : char printerval int32 : int32 printerval int64 : int64 printerval nativeint : nativeint printerval flush : unit printerAlias to Format.pp_print_flush.
val string_quoted : string printerSimilar to CCString.print.
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.
append ppa ppb first prints ppa (), then prints ppb ().
within a b p wraps p inside the strings a and b. Convenient, for instances, for brackets, parenthesis, quotes, etc.
val return : ('a, _, _, 'a) Stdlib.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 allval const_string : string -> 'a printerconst_string s is a printer that ignores its input and always prints s.
val opaque : 'a printeropaque is const_string "opaque". The exact string used is not stable.
lazy_force pp out x forces x and prints the result with pp.
lazy_or ?default pp out x prints default if x is not evaluated yet, or uses pp otherwise.
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 -> unitAdd functions to support color tags to the given formatter.
set_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.
status: unstable
val with_color_sf : string -> ('a, t, unit, string) Stdlib.format4 -> 'awith_color_sf "Blue" out "%s %d" "yolo" 42 will behave like sprintf, but wrapping the content with the given style.
Example:
CCFormat.with_color_sf "red" "%a" CCFormat.Dump.(list int) [1;2;3] |> print_endline;;status: unstable
val with_color_ksf : f:(string -> 'b) -> string -> ('a, t, unit, 'b) Stdlib.format4 -> 'awith_color_ksf "Blue" ~f "%s %d" "yolo" 42 will behave like 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];;module ANSI_codes : sig ... endANSI escape codes. This contains lower level functions for them.
val to_string : 'a printer -> 'a -> stringval of_chan : Stdlib.out_channel -> tAlias to Format.formatter_of_out_channel.
val with_out_chan : Stdlib.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) Stdlib.format4 -> 'aPrint into a string any format string that would usually be compatible with fprintf. Like Format.asprintf.
val sprintf_no_color : ('a, t, unit, string) Stdlib.format4 -> 'aLike sprintf but never prints colors.
val sprintf_dyn_color : colors:bool -> ('a, t, unit, string) Stdlib.format4 -> 'aLike sprintf but enable/disable colors depending on colors.
Example:
(* with colors *)
diff --git a/dev/containers/CCRandom/index.html b/dev/containers/CCRandom/index.html
index 5a4a567e..9641fd6d 100644
--- a/dev/containers/CCRandom/index.html
+++ b/dev/containers/CCRandom/index.html
@@ -1,5 +1,5 @@
-CCRandom (containers.CCRandom) Module CCRandom
Random Generators
include module type of struct include Stdlib.Random end
type 'a t = state -> 'aRandom generator for values of type 'a.
type 'a random_gen = 'a tval 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 need some code to run for every call. Example:
let gensym = let r = ref 0 in fun () -> incr r; !r ;;
+CCRandom (containers.CCRandom) Module CCRandom
Random Generators
include module type of struct include Stdlib.Random end
type 'a t = state -> 'aRandom generator for values of type 'a.
type 'a random_gen = 'a tval 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 need some code to run for every call. Example:
let gensym = let r = ref 0 in fun () -> incr r; !r ;;
delay (fun () ->
let name = gensym() in
diff --git a/dev/containers/CCShimsArrayLabels_/index.html b/dev/containers/CCShimsArrayLabels_/index.html
index 378614a4..6db44e83 100644
--- a/dev/containers/CCShimsArrayLabels_/index.html
+++ b/dev/containers/CCShimsArrayLabels_/index.html
@@ -1,3 +1,3 @@
CCShimsArrayLabels_ (containers.CCShimsArrayLabels_) Module CCShimsArrayLabels_
include module type of Stdlib.ArrayLabels with module Floatarray = Stdlib.Array.Floatarray
module Floatarray : sig ... end
\ No newline at end of file
+unit
module Floatarray : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCShimsArray_/index.html b/dev/containers/CCShimsArray_/index.html
index 52004a08..7da04b21 100644
--- a/dev/containers/CCShimsArray_/index.html
+++ b/dev/containers/CCShimsArray_/index.html
@@ -1,2 +1,2 @@
-CCShimsArray_ (containers.CCShimsArray_) Module CCShimsArray_
include module type of struct include Stdlib.Array end
\ No newline at end of file
+CCShimsArray_ (containers.CCShimsArray_) Module CCShimsArray_
include module type of struct include Stdlib.Array end
\ No newline at end of file
diff --git a/dev/containers/CCShimsInt_/index.html b/dev/containers/CCShimsInt_/index.html
index da0b758e..b56c16d5 100644
--- a/dev/containers/CCShimsInt_/index.html
+++ b/dev/containers/CCShimsInt_/index.html
@@ -1,2 +1,2 @@
-CCShimsInt_ (containers.CCShimsInt_) Module CCShimsInt_
include module type of struct include Stdlib.Int end
\ No newline at end of file
+CCShimsInt_ (containers.CCShimsInt_) Module CCShimsInt_
include module type of struct include Stdlib.Int end
\ No newline at end of file
diff --git a/dev/containers/CCString/index.html b/dev/containers/CCString/index.html
index be22883b..9b65ba4f 100644
--- a/dev/containers/CCString/index.html
+++ b/dev/containers/CCString/index.html
@@ -1,3 +1,3 @@
-CCString (containers.CCString) Module CCString
Basic String Utils
include module type of struct include Stdlib.String end
val to_seqi : t -> (int * char) Stdlib.Seq.tval length : t -> intlength s returns the length (number of characters) of the given string s.
val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unitblit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.
val fold : ('a -> char -> 'a) -> 'a -> t -> 'afold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].
val foldi : ('a -> int -> char -> 'a) -> 'a -> t -> 'afoldi f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.
Conversions
val to_seq : t -> char Stdlib.Seq.tto_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.
val to_list : t -> char listto_list s returns the list of characters contained in the string s.
val pp_buf : Stdlib.Buffer.t -> t -> unitpp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitpp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.
compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.
pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.
val of_gen : char gen -> stringof_gen gen converts a gen of characters to a string.
val of_iter : char iter -> stringof_iter iter converts an iter of characters to a string.
of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.
to_array s returns the array of characters contained in the string s.
find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.
val find_all : ?start:int -> sub:string -> string -> int genfind_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.
find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.
mem ~start ~sub s is true iff sub is a substring of s.
rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.
val replace : ?which:[ `Left | `Right | `All ] -> sub:string -> by:string ->
+CCString (containers.CCString) Module CCString
Basic String Utils
include module type of struct include Stdlib.String end
val to_seqi : t -> (int * char) Stdlib.Seq.tval length : t -> intlength s returns the length (number of characters) of the given string s.
val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unitblit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.
val fold : ('a -> char -> 'a) -> 'a -> t -> 'afold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].
val foldi : ('a -> int -> char -> 'a) -> 'a -> t -> 'afoldi f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.
Conversions
val to_seq : t -> char Stdlib.Seq.tto_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.
val to_list : t -> char listto_list s returns the list of characters contained in the string s.
val pp_buf : Stdlib.Buffer.t -> t -> unitpp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitpp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.
compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.
pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.
val of_gen : char gen -> stringof_gen gen converts a gen of characters to a string.
val of_iter : char iter -> stringof_iter iter converts an iter of characters to a string.
of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.
to_array s returns the array of characters contained in the string s.
find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.
val find_all : ?start:int -> sub:string -> string -> int genfind_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.
find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.
mem ~start ~sub s is true iff sub is a substring of s.
rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.
replace ~which ~sub ~by s replaces some occurrences of sub by by in s.
is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.
chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.
chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.
val lines_gen : string -> string genlines_gen s returns the gen of the lines of s (splits along '\n').
val lines_iter : string -> string iterlines_iter s returns the iter of the lines of s (splits along '\n').
lines_seq s returns the Seq.t of the lines of s (splits along '\n').
val concat_gen : sep:string -> string gen -> stringconcat_gen ~sep gen concatenates all strings of gen, separated with sep.
concat_seq ~sep seq concatenates all strings of seq, separated with sep.
val concat_iter : sep:string -> string iter -> stringconcat_iter ~sep iter concatenates all strings of iter, separated with sep.
val unlines_gen : string gen -> stringunlines_gen gen concatenates all strings of gen, separated with '\n'.
val unlines_iter : string iter -> stringunlines_iter iter concatenates all strings of iter, separated with '\n'.
unlines_seq seq concatenates all strings of seq, separated with '\n'.
set s i c creates a new string which is a copy of s, except for index i, which becomes c.
iter f s applies function f on each character of s. Alias to String.iter.
filter_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).
filter f s discards characters of s not satisfying f.
uniq eq s remove consecutive duplicate characters in s.
flat_map ~sep f s maps each chars of s to a string, then concatenates them all.
for_all f s is true iff all characters of s satisfy the predicate f.
exists f s is true iff some character of s satisfy the predicate f.
drop_while f s discards any characters of s starting from the left, up to the first character c not satisfying f c.
rdrop_while f s discards any characters of s starting from the right, up to the first character c not satisfying f c.
Operations on 2 strings
iter2 f s1 s2 iterates on pairs of chars.
iteri2 f s1 s2 iterates on pairs of chars with their index.
fold2 f init s1 s2 folds on pairs of chars.
for_all2 f s1 s2 returns true iff all pairs of chars satisfy the predicate f.
exists2 f s1 s2 returns true iff a pair of chars satisfy the predicate f.
Ascii functions
Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.
equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.
Finding
A relatively efficient algorithm for finding sub-strings.
module Find : sig ... endSplitting
module Split : sig ... endsplit_on_char by s splits the string s along the given char by.
split ~by s splits the string s along the given string by. Alias to Split.list_cpy.
Utils
compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.
compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order
edit_distance ~cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.
Infix operators
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCStringLabels/index.html b/dev/containers/CCStringLabels/index.html
index aa379a90..4ea39055 100644
--- a/dev/containers/CCStringLabels/index.html
+++ b/dev/containers/CCStringLabels/index.html
@@ -1,4 +1,4 @@
-CCStringLabels (containers.CCStringLabels) Module CCStringLabels
Basic String Utils (Labeled version of CCString)
include module type of struct include Stdlib.StringLabels end
val to_seqi : t -> (int * char) Stdlib.Seq.tval unsafe_blit : src:string -> src_pos:int -> dst:bytes -> dst_pos:int -> len:int ->
+CCStringLabels (containers.CCStringLabels) Module CCStringLabels
Basic String Utils (Labeled version of CCString)
include module type of struct include Stdlib.StringLabels end
val to_seqi : t -> (int * char) Stdlib.Seq.tval length : t -> intlength s returns the length (number of characters) of the given string s.
val blit : src:t -> src_pos:int -> dst:Stdlib.Bytes.t -> dst_pos:int -> len:int -> unitblit ~src ~src_pos ~dst ~dst_pos ~len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.
val fold : f:('a -> char -> 'a) -> init:'a -> t -> 'afold ~f ~init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].
val foldi : f:('a -> int -> char -> 'a) -> 'a -> t -> 'afoldi ~f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.
Conversions
val to_seq : t -> char Stdlib.Seq.tto_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.
val to_list : t -> char listto_list s returns the list of characters contained in the string s.
val pp_buf : Stdlib.Buffer.t -> t -> unitpp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitpp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.
Strings
compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.
pad ?side ?c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.
val of_gen : char gen -> stringof_gen gen converts a gen of characters to a string.
val of_iter : char iter -> stringof_iter iter converts an iter of characters to a string.
of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.
to_array s returns the array of characters contained in the string s.
find ?start ~sub s returns the starting index of the first occurrence of sub within s or -1.
val find_all : ?start:int -> sub:string -> string -> int genfind_all ?start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.
find_all_l ?start ~sub s finds all occurrences of sub in s and returns them in a list.
mem ?start ~sub s is true iff sub is a substring of s.
rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.
replace ?which ~sub ~by s replaces some occurrences of sub by by in s.
is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.
chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.
chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.
val lines_gen : string -> string genlines_gen s returns a generator gen of the lines of s (splits along '\n').
val lines_iter : string -> string iterlines_iter s returns the iter of the lines of s (splits along '\n').
lines_seq s returns the Seq.t of the lines of s (splits along '\n').
val concat_iter : sep:string -> string iter -> stringconcat_iter ~sep iter concatenates all strings of iter, separated with sep.
val concat_gen : sep:string -> string gen -> stringconcat_gen ~sep gen concatenates all strings of gen, separated with sep.
concat_seq ~sep seq concatenates all strings of seq, separated with sep.
val unlines_gen : string gen -> stringunlines_gen gen concatenates all strings of gen, separated with '\n'.
val unlines_iter : string iter -> stringunlines_iter iter concatenates all strings of iter, separated with '\n'.
unlines_seq seq concatenates all strings of seq, separated with '\n'.
set s i c creates a new string which is a copy of s, except for index i, which becomes c.
iter ~f s applies function f on each character of s. Alias to String.iter.
filter_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).
filter ~f s discards characters of s not satisfying f.
uniq ~eq s remove consecutive duplicate characters in s.
flat_map ?sep ~f s maps each chars of s to a string, then concatenates them all.
for_all ~f s is true iff all characters of s satisfy the predicate f.
exists ~f s is true iff some character of s satisfy the predicate f.
drop_while ~f s discards any characters of s starting from the left, up to the first character c not satisfying f c.
rdrop_while ~f s discards any characters of s starting from the right, up to the first character c not satisfying f c.
Operations on 2 strings
iter2 ~f s1 s2 iterates on pairs of chars.
iteri2 ~f s1 s2 iterates on pairs of chars with their index.
fold2 ~f ~init s1 s2 folds on pairs of chars.
for_all2 ~f s1 s2 returns true iff all pairs of chars satisfy the predicate f.
exists2 ~f s1 s2 returns true iff a pair of chars satisfy the predicate f.
Ascii functions
Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.
capitalize_ascii s returns a copy of s with the first character set to uppercase using the US-ASCII character set. See String.
uncapitalize_ascii s returns a copy of s with the first character set to lowercase using the US-ASCII character set. See String.
uppercase_ascii s returns a copy of s with all lowercase letters translated to uppercase using the US-ASCII character set. See String.
lowercase_ascii s returns a copy of s with all uppercase letters translated to lowercase using the US-ASCII character set. See String.
equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.
Finding
A relatively efficient algorithm for finding sub-strings.
module Find : sig ... endSplitting
module Split : sig ... endsplit_on_char ~by s splits the string s along the given char by.
split ~by s splits the string s along the given string by. Alias to Split.list_cpy.
Utils
compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.
compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order
edit_distance ?cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.
Infix operators
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/Make/index.html b/dev/containers/Containers/Hashtbl/Make/index.html
index e78af2e7..39c477b2 100644
--- a/dev/containers/Containers/Hashtbl/Make/index.html
+++ b/dev/containers/Containers/Hashtbl/Make/index.html
@@ -1,2 +1,2 @@
-Make (containers.Containers.Hashtbl.Make) Module Hashtbl.Make
Parameters
Signature
val create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> Stdlib__hashtbl.statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
+Make (containers.Containers.Hashtbl.Make) Module Hashtbl.Make
Parameters
Signature
val create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> Stdlib__Hashtbl.statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/MakeSeeded/index.html b/dev/containers/Containers/Hashtbl/MakeSeeded/index.html
index 7ce70dde..b25faf67 100644
--- a/dev/containers/Containers/Hashtbl/MakeSeeded/index.html
+++ b/dev/containers/Containers/Hashtbl/MakeSeeded/index.html
@@ -1,2 +1,2 @@
-MakeSeeded (containers.Containers.Hashtbl.MakeSeeded) Module Hashtbl.MakeSeeded
Parameters
module H : SeededHashedTypeSignature
type key = H.tval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
+MakeSeeded (containers.Containers.Hashtbl.MakeSeeded) Module Hashtbl.MakeSeeded
Parameters
module H : SeededHashedTypeSignature
type key = H.tval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/index.html b/dev/containers/Containers/Hashtbl/index.html
index 8cabf807..420de0e8 100644
--- a/dev/containers/Containers/Hashtbl/index.html
+++ b/dev/containers/Containers/Hashtbl/index.html
@@ -1,6 +1,6 @@
Hashtbl (containers.Containers.Hashtbl) Module Containers.Hashtbl
include module type of Stdlib.Hashtbl with type statistics = Stdlib.Hashtbl.statistics and module Make
-= Stdlib.Hashtbl.Make and type ('a, 'b) t = ('a, 'b) Stdlib.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 -> statisticsval to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.tval to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.tval to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.tval replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitmodule type HashedType = sig ... endmodule type S = sig ... endmodule type SeededHashedType = sig ... endmodule type SeededS = sig ... endmodule MakeSeeded (H : SeededHashedType) : sig ... endinclude module type of struct include CCHashtbl.Poly end
get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.
get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a CCHashtbl.iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.itervalues tbl f iterates on values in the table tbl.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
map_list f tbl maps on a tbl's items. Collect into a list.
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).
decr ?by tbl x is 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.
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iterIterate on bindings in the table.
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add.
val add_iter_with : f:('a -> 'b -> 'b -> 'b) ->
+= Stdlib.Hashtbl.Make and type ('a, 'b) t = ('a, 'b) Stdlib.Hashtbl.tval 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 -> statisticsval to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.tval to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.tval to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.tval replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitmodule type HashedType = sig ... endmodule type S = sig ... endmodule type SeededHashedType = sig ... endmodule type SeededS = sig ... endmodule MakeSeeded (H : SeededHashedType) : sig ... endinclude module type of struct include CCHashtbl.Poly end
get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.
get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a CCHashtbl.iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.itervalues tbl f iterates on values in the table tbl.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
map_list f tbl maps on a tbl's items. Collect into a list.
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).
decr ?by tbl x is 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.
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iterIterate on bindings in the table.
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add.
val add_iter_with : f:('a -> 'b -> 'b -> 'b) ->
('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
Add the corresponding pairs to the table, using Hashtbl.add. Renamed from add_std_seq since 3.0.
val add_seq_with : f:('a -> 'b -> 'b -> 'b) ->
('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) Stdlib.Seq.t -> unitAdd the corresponding pairs to the table. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
val of_iter : ('a * 'b) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order.
val of_iter_with : f:('a -> 'b -> 'b -> 'b) -> ('a * 'b) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
From the given bindings, added in order. Renamed from of_std_seq since 3.0.
From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
val add_iter_count : ('a, int) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter -> unitadd_iter_count tbl i increments the count of each element of i by calling incr. This is useful for counting how many times each element of i occurs.
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. Renamed from add_std_seq_count since 3.0.
val of_iter_count : 'a CCHashtbl.iter -> ('a, int) Stdlib.Hashtbl.tLike add_seq_count, but allocates a new table and returns it.
Like add_seq_count, but allocates a new table and returns it. Renamed from of_std_seq_count since 3.0.
to_list tbl returns the list of (key,value) bindings (order unspecified).
of_list l builds a table from the given list l 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.
From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
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.
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.
val pp : ?pp_start:unit CCHashtbl.printer -> ?pp_stop:unit CCHashtbl.printer -> ?pp_sep:unit CCHashtbl.printer -> ?pp_arrow:unit CCHashtbl.printer ->
'a CCHashtbl.printer -> 'b CCHashtbl.printer -> ('a, 'b) Stdlib.Hashtbl.t CCHashtbl.printerpp ~pp_start ~pp_stop ~pp_sep ~pp arrow pp_k pp_v returns a table printer given a pp_k printer for individual key and a pp_v printer for individual value. pp_start and pp_stop control the opening and closing delimiters, by default print nothing. pp_sep control the separator between binding. pp_arrow control the arrow between the key and value. Renamed from print since 2.0.
module type S' = CCHashtbl.Smodule Make' = CCHashtbl.Make
\ No newline at end of file
diff --git a/dev/containers/ContainersLabels/Hashtbl/Make/index.html b/dev/containers/ContainersLabels/Hashtbl/Make/index.html
index 7235b06b..46164ade 100644
--- a/dev/containers/ContainersLabels/Hashtbl/Make/index.html
+++ b/dev/containers/ContainersLabels/Hashtbl/Make/index.html
@@ -1,2 +1,2 @@
-Make (containers.ContainersLabels.Hashtbl.Make) Module Hashtbl.Make
Parameters
Signature
val create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> Stdlib__hashtbl.statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
+Make (containers.ContainersLabels.Hashtbl.Make) Module Hashtbl.Make
Parameters
Signature
val create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> Stdlib__Hashtbl.statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
diff --git a/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html
index 05bad718..b6676d82 100644
--- a/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html
+++ b/dev/containers/ContainersLabels/Hashtbl/MakeSeeded/index.html
@@ -1,2 +1,2 @@
-MakeSeeded (containers.ContainersLabels.Hashtbl.MakeSeeded) Module Hashtbl.MakeSeeded
Parameters
module H : SeededHashedTypeSignature
type key = H.tval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
+MakeSeeded (containers.ContainersLabels.Hashtbl.MakeSeeded) Module Hashtbl.MakeSeeded
Parameters
module H : SeededHashedTypeSignature
type key = H.tval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.t
\ No newline at end of file
diff --git a/dev/containers/ContainersLabels/Hashtbl/index.html b/dev/containers/ContainersLabels/Hashtbl/index.html
index 5c533ed8..3d170521 100644
--- a/dev/containers/ContainersLabels/Hashtbl/index.html
+++ b/dev/containers/ContainersLabels/Hashtbl/index.html
@@ -1,6 +1,6 @@
Hashtbl (containers.ContainersLabels.Hashtbl) Module ContainersLabels.Hashtbl
include module type of Stdlib.Hashtbl with type statistics = Stdlib.Hashtbl.statistics and module Make
-= Stdlib.Hashtbl.Make and type ('a, 'b) t = ('a, 'b) Stdlib.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 -> statisticsval to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.tval to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.tval to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.tval replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitmodule type HashedType = sig ... endmodule type S = sig ... endmodule type SeededHashedType = sig ... endmodule type SeededS = sig ... endmodule MakeSeeded (H : SeededHashedType) : sig ... endinclude module type of struct include CCHashtbl.Poly end
get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.
get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a CCHashtbl.iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.itervalues tbl f iterates on values in the table tbl.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
map_list f tbl maps on a tbl's items. Collect into a list.
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).
decr ?by tbl x is 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.
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iterIterate on bindings in the table.
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add.
val add_iter_with : f:('a -> 'b -> 'b -> 'b) ->
+= Stdlib.Hashtbl.Make and type ('a, 'b) t = ('a, 'b) Stdlib.Hashtbl.tval 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 -> statisticsval to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.tval to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.tval to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.tval replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitmodule type HashedType = sig ... endmodule type S = sig ... endmodule type SeededHashedType = sig ... endmodule type SeededS = sig ... endmodule MakeSeeded (H : SeededHashedType) : sig ... endinclude module type of struct include CCHashtbl.Poly end
get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.
get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a CCHashtbl.iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.itervalues tbl f iterates on values in the table tbl.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
map_list f tbl maps on a tbl's items. Collect into a list.
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).
decr ?by tbl x is 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.
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iterIterate on bindings in the table.
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add.
val add_iter_with : f:('a -> 'b -> 'b -> 'b) ->
('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
Add the corresponding pairs to the table, using Hashtbl.add. Renamed from add_std_seq since 3.0.
val add_seq_with : f:('a -> 'b -> 'b -> 'b) ->
('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) Stdlib.Seq.t -> unitAdd the corresponding pairs to the table. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
val of_iter : ('a * 'b) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order.
val of_iter_with : f:('a -> 'b -> 'b -> 'b) -> ('a * 'b) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
From the given bindings, added in order. Renamed from of_std_seq since 3.0.
From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
val add_iter_count : ('a, int) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter -> unitadd_iter_count tbl i increments the count of each element of i by calling incr. This is useful for counting how many times each element of i occurs.
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. Renamed from add_std_seq_count since 3.0.
val of_iter_count : 'a CCHashtbl.iter -> ('a, int) Stdlib.Hashtbl.tLike add_seq_count, but allocates a new table and returns it.
Like add_seq_count, but allocates a new table and returns it. Renamed from of_std_seq_count since 3.0.
to_list tbl returns the list of (key,value) bindings (order unspecified).
of_list l builds a table from the given list l 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.
From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
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.
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.
val pp : ?pp_start:unit CCHashtbl.printer -> ?pp_stop:unit CCHashtbl.printer -> ?pp_sep:unit CCHashtbl.printer -> ?pp_arrow:unit CCHashtbl.printer ->
'a CCHashtbl.printer -> 'b CCHashtbl.printer -> ('a, 'b) Stdlib.Hashtbl.t CCHashtbl.printerpp ~pp_start ~pp_stop ~pp_sep ~pp arrow pp_k pp_v returns a table printer given a pp_k printer for individual key and a pp_v printer for individual value. pp_start and pp_stop control the opening and closing delimiters, by default print nothing. pp_sep control the separator between binding. pp_arrow control the arrow between the key and value. Renamed from print since 2.0.
module type S' = CCHashtbl.Smodule Make' = CCHashtbl.Make
\ No newline at end of file