get 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"
-if n is outside the range 0 to (length a - 1).
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
-destination chunks overlap.
Raise Invalid_argument "Array.blit" if o1 and len do not
-designate a valid subarray of v1, or if o2 and len do not
-designate a valid subarray of v2.
sorted cmp a makes a copy of a and sorts it with cmp.
Since: 1.0
val sort_indices : ('a‑>'a‑> int) ‑>'at‑> int array
sort_indices cmp 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 cmp a
-appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices cmp a) = sorted cmp a.
-sort_indices yields the inverse permutation of sort_ranking.
Since: 1.0
val sort_ranking : ('a‑>'a‑> int) ‑>'at‑> int array
sort_ranking cmp a returns a new array b, with the same length as a,
-such that b.(i) is the index at which the i-the element of a appears
-in sorted cmp a. a is not modified.
In other words, map (fun i -> (sorted cmp a).(i)) (sort_ranking cmp 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 bsearch : cmp:('a‑>'a‑> int) ‑>'a‑>'at‑> [ `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
RaisesInvalid_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.
RaisesInvalid_argument: if the array is found to be unsorted w.r.t cmp.
exists 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).
Return a sequence of the elements of an array.
-The input array is shared with the sequence and modifications of it will result
-in modification of the sequence.
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)|].
RaisesInvalid_argument: if they have distinct lengths.
get 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" if n is outside the range 0 to (length a - 1).
blit a1 o1 a2 o2 len copies len elements from array a1, starting at element number o1, to array a2, starting at element number o2. It works correctly even if a1 and a2 are the same array, and the source and destination chunks overlap.
Raise Invalid_argument "CCArray.blit" if o1 and len do not designate a valid subarray of a1, or if o2 and len do not designate a valid subarray of a2.
val sort_indices : ('a->'a-> int) ->'at-> int array
sort_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.
since
1.0
val sort_ranking : ('a->'a-> int) ->'at-> int array
sort_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).
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).
returns
None if the key key is not present, or Some i (i the index of the key) otherwise.
val bsearch : cmp:('a->'a-> int) ->'a->'at-> [ `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).
returns
`At i if cmp a.(i) key = 0 (for some i).
`All_lower if all elements of a are lower than key.
`All_bigger if all elements of a are bigger than key.
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).
raises Invalid_argument
if arrays have distinct lengths. Allow different types.
exists f [|a1; ...; an|] is true if at least one element of the array satisfies the predicate f. That is, it returns (f a1) || (f a2) || ... || (f an).
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).
raises Invalid_argument
if arrays have distinct lengths. Allow different types.
since
0.20
val fold2 : ('acc->'a->'b->'acc) ->'acc->'at->'bt->'acc
fold2 f init a b fold on two arrays a and b stepwise. It computes f (... (f init a1 b1)...) an bn.
shuffle_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).
to_seq a returns a sequence 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.
pp_i ~sep pp_item ppf a prints the array a on ppf. The printing function pp_item is giving both index and element. Elements are separated by sep (defaults to ", ").
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_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.
val sort_generic : (moduleMONO_ARRAYwithtypeelt = 'eltandtypet = 'arr) -> cmp:('elt->'elt-> int) ->'arr-> unit
sort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.
since
0.14
\ No newline at end of file
diff --git a/dev/containers/CCArray/module-type-MONO_ARRAY/index.html b/dev/containers/CCArray/module-type-MONO_ARRAY/index.html
index 81b820cf..db179785 100644
--- a/dev/containers/CCArray/module-type-MONO_ARRAY/index.html
+++ b/dev/containers/CCArray/module-type-MONO_ARRAY/index.html
@@ -1,2 +1,2 @@
-MONO_ARRAY (containers.CCArray.MONO_ARRAY)
\ No newline at end of file
diff --git a/dev/containers/CCArrayLabels/index.html b/dev/containers/CCArrayLabels/index.html
index 96a30518..7a9edfe8 100644
--- a/dev/containers/CCArrayLabels/index.html
+++ b/dev/containers/CCArrayLabels/index.html
@@ -1,52 +1,2 @@
-CCArrayLabels (containers.CCArrayLabels)
ModuleCCArrayLabels
Array utils
type 'a sequence = ('a‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'aklist ]
get 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"
-if n is outside the range 0 to (length a - 1).
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
-destination chunks overlap.
Raise Invalid_argument "Array.blit" if o1 and len do not
-designate a valid subarray of v1, or if o2 and len do not
-designate a valid subarray of v2.
sorted cmp a makes a copy of a and sorts it with cmp.
Since: 1.0
val sort_indices : f:('a‑>'a‑> int) ‑>'at‑> int array
sort_indices cmp 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 cmp a
-appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices cmp a) = sorted cmp a.
-sort_indices yields the inverse permutation of sort_ranking.
Since: 1.0
val sort_ranking : f:('a‑>'a‑> int) ‑>'at‑> int array
sort_ranking cmp a returns a new array b, with the same length as a,
-such that b.(i) is the index at which the i-the element of a appears
-in sorted cmp a. a is not modified.
In other words, map (fun i -> (sorted cmp a).(i)) (sort_ranking cmp 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 bsearch : cmp:('a‑>'a‑> int) ‑> key:'a‑>'at‑> [ `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.
RaisesInvalid_argument: if the array is found to be unsorted w.r.t cmp.
exists 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).
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)|].
RaisesInvalid_argument: if they have distinct lengths.
get 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" if n is outside the range 0 to (length a - 1).
blit a1 o1 a2 o2 len copies len elements from array a1, starting at element number o1, to array a2, starting at element number o2. It works correctly even if a1 and a2 are the same array, and the source and destination chunks overlap.
Raise Invalid_argument "CCArray.blit" if o1 and len do not designate a valid subarray of a1, or if o2 and len do not designate a valid subarray of a2.
sorted ~f a makes a copy of a and sorts it with ~f.
since
1.0
val sort_indices : f:('a->'a-> int) ->'at-> int array
sort_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.
since
1.0
val sort_ranking : f:('a->'a-> int) ->'at-> int array
sort_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).
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).
returns
None if the key ~key is not present, or Some i (i the index of the key) otherwise.
val bsearch : cmp:('a->'a-> int) -> key:'a->'at-> [ `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).
returns
`At i if cmp a.(i) key = 0 (for some i).
`All_lower if all elements of a are lower than key.
`All_bigger if all elements of a are bigger than key.
for_all ~f [|a1; ...; an|] is true if all elements of the array satisfy the predicate ~f. That is, it returns (~f a1) && (~f a2) && ... && (~f an).
val for_all2 : f:('a->'b-> bool) ->'at->'bt-> bool
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).
raises Invalid_argument
if arrays have distinct lengths. Allow different types.
exists ~f [|a1; ...; an|] is true if at least one element of the array satisfies the predicate ~f. That is, it returns (~f a1) || (~f a2) || ... || (~f an).
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).
raises Invalid_argument
if arrays have distinct lengths. Allow different types.
since
0.20
val fold2 : f:('acc->'a->'b->'acc) -> init:'acc->'at->'bt->'acc
fold2 ~f ~init a b fold on two arrays a and b stepwise. It computes ~f (... (~f ~init a1 b1)...) an bn.
shuffle_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).
to_seq a returns a sequence 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.
pp_i ~sep pp_item ppf a prints the array a on ppf. The printing function pp_item is giving both index and element. Elements are separated by sep (defaults to ", ").
map ~f a applies function f to all 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 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_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.
val sort_generic : (moduleMONO_ARRAYwithtypeelt = 'eltandtypet = 'arr) -> cmp:('elt->'elt-> int) ->'arr-> unit
sort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.
since
0.14
\ No newline at end of file
diff --git a/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html b/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html
index 132c122c..c781e7c7 100644
--- a/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html
+++ b/dev/containers/CCArrayLabels/module-type-MONO_ARRAY/index.html
@@ -1,2 +1,2 @@
-MONO_ARRAY (containers.CCArrayLabels.MONO_ARRAY)
\ No newline at end of file
diff --git a/dev/containers/CCArray_slice/index.html b/dev/containers/CCArray_slice/index.html
index 755a91cb..4535b553 100644
--- a/dev/containers/CCArray_slice/index.html
+++ b/dev/containers/CCArray_slice/index.html
@@ -1,42 +1,2 @@
-CCArray_slice (containers.CCArray_slice)
ModuleCCArray_slice
Array Slice
type 'a sequence = ('a‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'aklist ]
get 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"
-if n is outside the range 0 to (length a - 1).
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
-destination chunks overlap.
Raise Invalid_argument "Array.blit" if o1 and len do not
-designate a valid subarray of v1, or if o2 and len do not
-designate a valid subarray of v2.
sorted cmp a makes a copy of a and sorts it with cmp.
Since: 1.0
val sort_indices : ('a‑>'a‑> int) ‑>'at‑> int array
sort_indices cmp 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 cmp a
-appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices cmp a) = sorted cmp a.
-sort_indices yields the inverse permutation of sort_ranking.
Since: 1.0
val sort_ranking : ('a‑>'a‑> int) ‑>'at‑> int array
sort_ranking cmp a returns a new array b, with the same length as a,
-such that b.(i) is the index at which the i-the element of a appears
-in sorted cmp a. a is not modified.
In other words, map (fun i -> (sorted cmp a).(i)) (sort_ranking cmp 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 bsearch : cmp:('a‑>'a‑> int) ‑>'a‑>'at‑> [ `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.
RaisesInvalid_argument: if the array is found to be unsorted w.r.t cmp.
exists 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).
get as n returns the element number n of slice as. The first element has number 0. The last element has number length as - 1. You can also write as.(n) instead of get as n.
Raise Invalid_argument "index out of bounds" if n is outside the range 0 to (length as - 1).
blit as1 o1 as2 o2 len copies len elements from slice as1, starting at element number o1, to slice as2, starting at element number o2. It works correctly even if as1 and as2 are the same slice, and the source and destination chunks overlap.
Raise Invalid_argument "CCArray_slice.blit" if o1 and len do not designate a valid subarray of as1, or if o2 and len do not designate a valid subarray of as2.
sorted cmp as makes a copy of as and sorts it with cmp.
since
1.0
val sort_indices : ('a->'a-> int) ->'at-> int array
sort_indices cmp as returns a new array b, with the same length as as, such that b.(i) is the index at which the i-th element of sorted cmp as appears in as. as is not modified.
In other words, map (fun i -> as.(i)) (sort_indices cmp as) = sorted cmp as. sort_indices yields the inverse permutation of sort_ranking.
since
1.0
val sort_ranking : ('a->'a-> int) ->'at-> int array
sort_ranking cmp as returns a new array b, with the same length as as, such that b.(i) is the index at which the i-th element of as appears in sorted cmp as. as is not modified.
In other words, map (fun i -> (sorted cmp as).(i)) (sort_ranking cmp as) = as. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in as, we also have lookup_exn as.(i) (sorted as) = (sorted_ranking as).(i).
val bsearch : cmp:('a->'a-> int) ->'a->'at-> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]
bsearch ~cmp x as finds the index of the object x in the slice as, provided as is sorted using cmp. If the slice is not sorted, the result is not specified (may raise Invalid_argument).
Complexity: O(log n) where n is the length of the slice as (dichotomic search).
returns
`At i if cmp as.(i) x = 0 (for some i).
`All_lower if all elements of as are lower than x.
`All_bigger if all elements of as are bigger than x.
for_all2 p [|as1; ...; asn|] [|bs1; ...; bsn|] is true if each pair of elements asi bsi satisfies the predicate p. That is, it returns (p as1 bs1) && (p as2 bs2) && ... && (p asn bsn).
raises Invalid_argument
if slices have distinct lengths. Allow different types.
exists p [|as1; ...; asn|] is true if at least one element of the slice satisfies the predicate p. That is, it returns (p as1) || (p as2) || ... || (p asn).
exists2 p [|as1; ...; asn|] [|bs1; ...; bsn|] is true if any pair of elements asi bsi satisfies the predicate p. That is, it returns (p as1 bs1) || (p as2 bs2) || ... || (p asn bsn).
raises Invalid_argument
if slices have distinct lengths. Allow different types.
since
0.20
val fold2 : ('acc->'a->'b->'acc) ->'acc->'at->'bt->'acc
fold2 f acc as bs fold on two slices as and bs stepwise. It computes f (... (f acc as1 bs1)...) asn bsn.
shuffle_with rs as randomly shuffles the slice as (like shuffle) but a specialized random state rs is used to control the random numbers being produced during shuffling (for reproducibility).
to_seq as returns a sequence of the elements of a slice as. The input slice as is shared with the sequence and modification of it will result in modification of the sequence.
pp_i ~sep pp_item ppf as prints the slice as on ppf. The printing function pp_item is giving both index and element. Elements are separated by sep (defaults to ", ").
\ No newline at end of file
diff --git a/dev/containers/CCBool/index.html b/dev/containers/CCBool/index.html
index fb335818..9227de80 100644
--- a/dev/containers/CCBool/index.html
+++ b/dev/containers/CCBool/index.html
@@ -1,2 +1,2 @@
-CCBool (containers.CCBool)
\ No newline at end of file
diff --git a/dev/containers/CCChar/index.html b/dev/containers/CCChar/index.html
index 34ab697a..c544f98a 100644
--- a/dev/containers/CCChar/index.html
+++ b/dev/containers/CCChar/index.html
@@ -1,9 +1,2 @@
-CCChar (containers.CCChar)
The comparison function for characters, with the same specification as
-Pervasives.compare. Along with the type t, this function compare
-allows the module Char to be passed as argument to the functors
-Set.Make and Map.Make.
The comparison function for characters, with the same specification as Pervasives.compare. Along with the type t, this function compare allows the module Char to be passed as argument to the functors Set.Make and Map.Make.
\ No newline at end of file
diff --git a/dev/containers/CCEqual/Infix/index.html b/dev/containers/CCEqual/Infix/index.html
index a69ba8ed..e27f133e 100644
--- a/dev/containers/CCEqual/Infix/index.html
+++ b/dev/containers/CCEqual/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCEqual.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCEqual/index.html b/dev/containers/CCEqual/index.html
index 77d10d54..2f48a084 100644
--- a/dev/containers/CCEqual/index.html
+++ b/dev/containers/CCEqual/index.html
@@ -1,7 +1,2 @@
-CCEqual (containers.CCEqual)
ModuleCCEqual
Equality Combinators
Since: 1.2
type 'a t = 'a‑>'a‑> bool
Equality function. Must be transitive, symmetric, and reflexive.
map 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.
map 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.
\ No newline at end of file
diff --git a/dev/containers/CCFloat/Infix/index.html b/dev/containers/CCFloat/Infix/index.html
index 6d8c0861..919c3ba1 100644
--- a/dev/containers/CCFloat/Infix/index.html
+++ b/dev/containers/CCFloat/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCFloat.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCFloat/index.html b/dev/containers/CCFloat/index.html
index 8b74ab5b..b2883875 100644
--- a/dev/containers/CCFloat/index.html
+++ b/dev/containers/CCFloat/index.html
@@ -1,8 +1,2 @@
-CCFloat (containers.CCFloat)
\ No newline at end of file
diff --git a/dev/containers/CCFormat/Dump/index.html b/dev/containers/CCFormat/Dump/index.html
index b488489f..5c52cb74 100644
--- a/dev/containers/CCFormat/Dump/index.html
+++ b/dev/containers/CCFormat/Dump/index.html
@@ -1,2 +1,2 @@
-Dump (containers.CCFormat.Dump)
\ No newline at end of file
diff --git a/dev/containers/CCFormat/index.html b/dev/containers/CCFormat/index.html
index cdb21fb0..6c41e004 100644
--- a/dev/containers/CCFormat/index.html
+++ b/dev/containers/CCFormat/index.html
@@ -1,44 +1,14 @@
-CCFormat (containers.CCFormat)
Add functions to support color tags to the given formatter.
Since: 0.15
val set_color_default : bool ‑> unit
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.
val with_out_chan : Pervasives.out_channel ‑> (t‑>'a) ‑>'a
with_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.
Add functions to support color tags to the given formatter.
since
0.15
val set_color_default : bool -> unit
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.
val with_out_chan : Pervasives.out_channel -> (t->'a) ->'a
with_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.
\ No newline at end of file
diff --git a/dev/containers/CCFun/Monad/argument-1-X/index.html b/dev/containers/CCFun/Monad/argument-1-X/index.html
index 2aecaebc..815b1ee1 100644
--- a/dev/containers/CCFun/Monad/argument-1-X/index.html
+++ b/dev/containers/CCFun/Monad/argument-1-X/index.html
@@ -1,2 +1,2 @@
-1-X (containers.CCFun.Monad.1-X)
ParameterCCFun.Monad.1-X
type t
\ No newline at end of file
+1-X (containers.CCFun.Monad.1-X)
Parameter Monad.1-X
type t
\ No newline at end of file
diff --git a/dev/containers/CCFun/Monad/index.html b/dev/containers/CCFun/Monad/index.html
index 67350d69..adfaf985 100644
--- a/dev/containers/CCFun/Monad/index.html
+++ b/dev/containers/CCFun/Monad/index.html
@@ -1,2 +1,2 @@
-Monad (containers.CCFun.Monad)
\ No newline at end of file
diff --git a/dev/containers/CCFun/index.html b/dev/containers/CCFun/index.html
index 744a839b..02cbea9c 100644
--- a/dev/containers/CCFun/index.html
+++ b/dev/containers/CCFun/index.html
@@ -1,18 +1,4 @@
-CCFun (containers.CCFun)
ModuleCCFun
Basic Functions
val (|>) : 'a‑> ('a‑>'b) ‑>'b
A 'pipe' operator. x |> f is the same as f x.
val compose : ('a‑>'b) ‑> ('b‑>'c) ‑>'a‑>'c
Composition. compose f g x is g (f x).
val compose_binop : ('a‑>'b) ‑> ('b‑>'b‑>'c) ‑>'a‑>'a‑>'c
compose_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 (%>) : ('a‑>'b) ‑> ('b‑>'c) ‑>'a‑>'c
Alias to compose.
val (@@) : ('a‑>'b) ‑>'a‑>'b
f @@ x is the same as f x, but right-associative.
Since: 0.5
val id : 'a‑>'a
Identity function.
val const : 'a‑>'b‑>'a
Produce a function that just returns its first argument.
-const x y = x for any y.
val flip : ('a‑>'b‑>'c) ‑>'b‑>'a‑>'c
Reverse the order of arguments for a binary function.
val curry : (('a * 'b) ‑>'c) ‑>'a‑>'b‑>'c
Convert 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) ‑>'c
Convert 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‑>'a
tap f x evaluates f x, discards it, then returns x. Useful
-in a pipeline, for instance:
-
CCArray.(1 -- 10)
+CCFun (containers.CCFun)
Module CCFun
Basic Functions
val (|>) : 'a-> ('a->'b) ->'b
A 'pipe' operator. x |> f is the same as f x.
val compose : ('a->'b) -> ('b->'c) ->'a->'c
Composition. compose f g x is g (f x).
val compose_binop : ('a->'b) -> ('b->'b->'c) ->'a->'a->'c
compose_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 (%>) : ('a->'b) -> ('b->'c) ->'a->'c
Alias to compose.
val (@@) : ('a->'b) ->'a->'b
f @@ x is the same as f x, but right-associative.
since
0.5
val id : 'a->'a
Identity function.
val const : 'a->'b->'a
Produce a function that just returns its first argument. const x y = x for any y.
val flip : ('a->'b->'c) ->'b->'a->'c
Reverse the order of arguments for a binary function.
val curry : (('a * 'b) ->'c) ->'a->'b->'c
Convert 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) ->'c
Convert 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->'a
tap 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 (%) : ('b‑>'c) ‑> ('a‑>'b) ‑>'a‑>'c
Mathematical composition. (%) f g x is f (g x).
val lexicographic : ('a‑>'a‑> int) ‑> ('a‑>'a‑> int) ‑>'a‑>'a‑> int
Lexicographic combination of comparison functions.
val finally : h:(unit ‑>_) ‑> f:(unit ‑>'a) ‑>'a
finally 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‑>'b
finally1 ~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‑>'c
finally2 ~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‑>'a
opaque_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
val iterate : int ‑> ('a‑>'a) ‑>'a‑>'a
iterate n f is f iterated n times. That is to say, iterate 0 f x is
-x, iterate 1 f x is f x, iterate 2 f x is f (f x), etc.
Since: 2.1
Monad
Functions with a fixed domain are monads in their codomain.
module Monad : functor (X : sig ... end) -> sig ... end
\ No newline at end of file
+ |> tap @@ CCArray.sort Pervasives.compare
val (%) : ('b->'c) -> ('a->'b) ->'a->'c
Mathematical composition. (%) f g x is f (g x).
val lexicographic : ('a->'a-> int) -> ('a->'a-> int) ->'a->'a-> int
Lexicographic combination of comparison functions.
val finally : h:(unit ->_) -> f:(unit ->'a) ->'a
finally 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->'b
finally1 ~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->'c
finally2 ~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->'a
opaque_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
val iterate : int -> ('a->'a) ->'a->'a
iterate n f is f iterated n times. That is to say, iterate 0 f x is x, iterate 1 f x is f x, iterate 2 f x is f (f x), etc.
since
2.1
Monad
Functions with a fixed domain are monads in their codomain.
moduleMonad : functor (X : sig ... end) ->sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCHash/index.html b/dev/containers/CCHash/index.html
index 149af87c..ad4090c2 100644
--- a/dev/containers/CCHash/index.html
+++ b/dev/containers/CCHash/index.html
@@ -1,8 +1,2 @@
-CCHash (containers.CCHash)
Always 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).
Always 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).
\ No newline at end of file
diff --git a/dev/containers/CCHashtbl/Poly/index.html b/dev/containers/CCHashtbl/Poly/index.html
index a3321b61..b18ec5f1 100644
--- a/dev/containers/CCHashtbl/Poly/index.html
+++ b/dev/containers/CCHashtbl/Poly/index.html
@@ -1,21 +1,2 @@
-Poly (containers.CCHashtbl.Poly)
ModuleCCHashtbl.Poly
val get : ('a, 'b) Hashtbl.t ‑>'a‑>'b option
Safe version of Hashtbl.find.
val get_or : ('a, 'b) Hashtbl.t ‑>'a‑> default:'b‑>'b
get_or tbl k ~default returns the value associated to k if present,
-and returns default otherwise (if k doesn't belong in tbl).
keys_list t is the list of keys in t.
-If the key is in the Hashtable multiple times, all occurrences will be returned.
Since: 0.8
val values_list : ('a, 'b) Hashtbl.t ‑>'b list
values_list t is the list of values in t.
Since: 0.8
val map_list : ('a‑>'b‑>'c) ‑> ('a, 'b) Hashtbl.t ‑>'c list
Map on a hashtable's items, collect into a list.
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑>'a‑> unit
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).
Parameterby: if specified, the int value is incremented by by rather than 1.
Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑>'a‑> unit
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 add_list : ('a, 'b list) Hashtbl.t ‑>'a‑>'b‑> unit
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
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) sequence‑> unit
Add the corresponding pairs to the table, using Hashtbl.add.
Since: 0.16
val of_seq : ('a * 'b) sequence‑> ('a, 'b) Hashtbl.t
From the given bindings, added in order.
val add_seq_count : ('a, int) Hashtbl.t ‑>'asequence‑> unit
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
val of_seq_count : 'asequence‑> ('a, int) Hashtbl.t
Like add_seq_count, but allocates a new table and returns it.
Since: 0.16
val to_list : ('a, 'b) Hashtbl.t ‑> ('a * 'b) list
List of bindings (order unspecified).
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.t
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.
val update : ('a, 'b) Hashtbl.t ‑> f:('a‑>'b option ‑>'b option) ‑> k:'a‑> unit
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
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a‑>'b) ‑> k:'a‑>'b
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.
keys_list t is the list of keys in t. If the key is in the Hashtable multiple times, all occurrences will be returned.
since
0.8
val values_list : ('a, 'b) Hashtbl.t ->'b list
values_list t is the list of values in t.
since
0.8
val map_list : ('a->'b->'c) -> ('a, 'b) Hashtbl.t ->'c list
Map on a hashtable's items, collect into a list.
val incr : ?by:int -> ('a, int) Hashtbl.t ->'a-> unit
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
val decr : ?by:int -> ('a, int) Hashtbl.t ->'a-> unit
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 add_list : ('a, 'b list) Hashtbl.t ->'a->'b-> unit
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
val add_seq : ('a, 'b) Hashtbl.t -> ('a * 'b) sequence-> unit
Add the corresponding pairs to the table, using Hashtbl.add.
since
0.16
val of_seq : ('a * 'b) sequence-> ('a, 'b) Hashtbl.t
From the given bindings, added in order.
val add_seq_count : ('a, int) Hashtbl.t ->'asequence-> unit
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
val of_seq_count : 'asequence-> ('a, int) Hashtbl.t
Like add_seq_count, but allocates a new table and returns it.
since
0.16
val to_list : ('a, 'b) Hashtbl.t -> ('a * 'b) list
List of bindings (order unspecified).
val of_list : ('a * 'b) list -> ('a, 'b) Hashtbl.t
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.
val update : ('a, 'b) Hashtbl.t -> f:('a->'b option ->'b option) -> k:'a-> unit
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
val get_or_add : ('a, 'b) Hashtbl.t -> f:('a->'b) -> k:'a->'b
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.
\ No newline at end of file
diff --git a/dev/containers/CCHashtbl/index.html b/dev/containers/CCHashtbl/index.html
index 8ebc49c4..ec2c9576 100644
--- a/dev/containers/CCHashtbl/index.html
+++ b/dev/containers/CCHashtbl/index.html
@@ -1,21 +1,2 @@
-CCHashtbl (containers.CCHashtbl)
ModuleCCHashtbl
Extension to the standard Hashtbl
Since: 0.4
type 'a sequence = ('a‑> unit) ‑> unit
type 'a eq = 'a‑>'a‑> bool
type 'a hash = 'a‑> int
type 'a printer = Format.formatter ‑>'a‑> unit
Polymorphic tables
This sub-module contains the extension of the standard polymorphic Hashtbl.
keys_list t is the list of keys in t.
-If the key is in the Hashtable multiple times, all occurrences will be returned.
Since: 0.8
val values_list : ('a, 'b) Hashtbl.t ‑>'b list
values_list t is the list of values in t.
Since: 0.8
val map_list : ('a‑>'b‑>'c) ‑> ('a, 'b) Hashtbl.t ‑>'c list
Map on a hashtable's items, collect into a list.
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑>'a‑> unit
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).
Parameterby: if specified, the int value is incremented by by rather than 1.
Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑>'a‑> unit
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 add_list : ('a, 'b list) Hashtbl.t ‑>'a‑>'b‑> unit
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
val add_seq : ('a, 'b) Hashtbl.t ‑> ('a * 'b) sequence‑> unit
Add the corresponding pairs to the table, using Hashtbl.add.
Since: 0.16
val of_seq : ('a * 'b) sequence‑> ('a, 'b) Hashtbl.t
From the given bindings, added in order.
val add_seq_count : ('a, int) Hashtbl.t ‑>'asequence‑> unit
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
val of_seq_count : 'asequence‑> ('a, int) Hashtbl.t
Like add_seq_count, but allocates a new table and returns it.
Since: 0.16
val to_list : ('a, 'b) Hashtbl.t ‑> ('a * 'b) list
List of bindings (order unspecified).
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.t
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.
val update : ('a, 'b) Hashtbl.t ‑> f:('a‑>'b option ‑>'b option) ‑> k:'a‑> unit
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
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a‑>'b) ‑> k:'a‑>'b
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.
keys_list t is the list of keys in t. If the key is in the Hashtable multiple times, all occurrences will be returned.
since
0.8
val values_list : ('a, 'b) Hashtbl.t ->'b list
values_list t is the list of values in t.
since
0.8
val map_list : ('a->'b->'c) -> ('a, 'b) Hashtbl.t ->'c list
Map on a hashtable's items, collect into a list.
val incr : ?by:int -> ('a, int) Hashtbl.t ->'a-> unit
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
val decr : ?by:int -> ('a, int) Hashtbl.t ->'a-> unit
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 add_list : ('a, 'b list) Hashtbl.t ->'a->'b-> unit
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
val add_seq : ('a, 'b) Hashtbl.t -> ('a * 'b) sequence-> unit
Add the corresponding pairs to the table, using Hashtbl.add.
since
0.16
val of_seq : ('a * 'b) sequence-> ('a, 'b) Hashtbl.t
From the given bindings, added in order.
val add_seq_count : ('a, int) Hashtbl.t ->'asequence-> unit
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
val of_seq_count : 'asequence-> ('a, int) Hashtbl.t
Like add_seq_count, but allocates a new table and returns it.
since
0.16
val to_list : ('a, 'b) Hashtbl.t -> ('a * 'b) list
List of bindings (order unspecified).
val of_list : ('a * 'b) list -> ('a, 'b) Hashtbl.t
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.
val update : ('a, 'b) Hashtbl.t -> f:('a->'b option ->'b option) -> k:'a-> unit
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
val get_or_add : ('a, 'b) Hashtbl.t -> f:('a->'b) -> k:'a->'b
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.
module Make : functor (X : Hashtbl.HashedType) ->SwithtypeMake.key = X.t andtype 'a Make.t = 'a Hashtbl.Make(X).t
\ No newline at end of file
diff --git a/dev/containers/CCHashtbl/module-type-S/index.html b/dev/containers/CCHashtbl/module-type-S/index.html
index 54d7a5df..f078d6dd 100644
--- a/dev/containers/CCHashtbl/module-type-S/index.html
+++ b/dev/containers/CCHashtbl/module-type-S/index.html
@@ -1,21 +1,2 @@
-S (containers.CCHashtbl.S)
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).
Parameterby: if specified, the int value is incremented by by rather than 1.
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.
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.
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.
val update : 'at‑> f:(key‑>'a option ‑>'a option) ‑> k:key‑> unit
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.
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.
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.
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.
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.
val update : 'at-> f:(key->'a option ->'a option) -> k:key-> unit
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.
\ No newline at end of file
diff --git a/dev/containers/CCHeap/Make/argument-1-E/index.html b/dev/containers/CCHeap/Make/argument-1-E/index.html
index 6173385d..b0e09a7b 100644
--- a/dev/containers/CCHeap/Make/argument-1-E/index.html
+++ b/dev/containers/CCHeap/Make/argument-1-E/index.html
@@ -1,2 +1,2 @@
-1-E (containers.CCHeap.Make.1-E)
leq x y shall return true iff x is lower or equal to y.
\ No newline at end of file
diff --git a/dev/containers/CCHeap/Make/index.html b/dev/containers/CCHeap/Make/index.html
index 31a9e3c1..31a8e2ec 100644
--- a/dev/containers/CCHeap/Make/index.html
+++ b/dev/containers/CCHeap/Make/index.html
@@ -1,13 +1,2 @@
-Make (containers.CCHeap.Make)
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.
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.
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.
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.
\ No newline at end of file
diff --git a/dev/containers/CCHeap/index.html b/dev/containers/CCHeap/index.html
index 1d0591ff..5df93cb0 100644
--- a/dev/containers/CCHeap/index.html
+++ b/dev/containers/CCHeap/index.html
@@ -1,2 +1,2 @@
-CCHeap (containers.CCHeap)
ModuleCCHeap
Leftist Heaps
following Okasaki
type 'a sequence = ('a‑> unit) ‑> unit
type 'a gen = unit ‑>'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'aklist ]
type 'a ktree = unit ‑> [ `Nil | `Node of 'a * 'aktree list ]
A convenient version of Make that take a TOTAL_ORD instead of a partially ordered module. It allow to directly pass modules that implement compare without implementing leq explicitly
\ No newline at end of file
diff --git a/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html b/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html
index b5e693f3..681f2275 100644
--- a/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html
+++ b/dev/containers/CCHeap/module-type-PARTIAL_ORD/index.html
@@ -1,2 +1,2 @@
-PARTIAL_ORD (containers.CCHeap.PARTIAL_ORD)
leq x y shall return true iff x is lower or equal to y.
\ No newline at end of file
diff --git a/dev/containers/CCHeap/module-type-S/index.html b/dev/containers/CCHeap/module-type-S/index.html
index 43577598..274c0867 100644
--- a/dev/containers/CCHeap/module-type-S/index.html
+++ b/dev/containers/CCHeap/module-type-S/index.html
@@ -1,13 +1,2 @@
-S (containers.CCHeap.S)
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.
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.
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.
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.
\ No newline at end of file
diff --git a/dev/containers/CCIO/File/index.html b/dev/containers/CCIO/File/index.html
index 510e259d..f6875fa7 100644
--- a/dev/containers/CCIO/File/index.html
+++ b/dev/containers/CCIO/File/index.html
@@ -1,14 +1,2 @@
-File (containers.CCIO.File)
ModuleCCIO.File
type t = string
A file should be represented by its absolute path, but currently
-this is not enforced.
Like 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.)
RaisesSys_error: in case of error (e.g. permission denied) during iteration.
with_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
+File (containers.CCIO.File)
Module CCIO.File
type t = string
A file should be represented by its absolute path, but currently this is not enforced.
Like 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.
with_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
diff --git a/dev/containers/CCIO/index.html b/dev/containers/CCIO/index.html
index d71a58b9..618d2b00 100644
--- a/dev/containers/CCIO/index.html
+++ b/dev/containers/CCIO/index.html
@@ -1,23 +1,13 @@
-CCIO (containers.CCIO)
ModuleCCIO
IO Utils
Simple utilities to deal with basic Input/Output tasks in a resource-safe
-way. For advanced IO tasks, the user is advised to use something
-like Lwt or Async, that are far more comprehensive.
Examples:
obtain the list of lines of a file:
# let l = CCIO.(with_in "/tmp/some_file" read_lines);;
transfer one file into another:
# CCIO.(
- with_in "/tmp/input"
- (fun ic ->
- let chunks = read_chunks ic in
- with_out ~flags:[Open_binary] ~mode:0o644 "/tmp/output"
- (fun oc ->
- write_gen oc chunks
- )
- )
- ) ;;
Since: 0.6
Before 0.12.was in 'containers.io', now moved into 'containers'
type 'a or_error = ('a, string) Result.result
type 'a gen = unit ‑>'a option
See Gen in the gen library.
Input
val with_in : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑>'a) ‑>'a
Open 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.
RaisesSys_error: in case of error (same as open_in and close_in).
Parameterflags: opening flags (default [Open_text]). Open_rdonly is used in any cases.
val read_chunks : ?size:int ‑> Pervasives.in_channel ‑> string gen
Read the channel's content into chunks of size size.
val read_line : Pervasives.in_channel ‑> string option
Read 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 gen
Read all lines. The generator should be traversed only once.
val read_lines_l : Pervasives.in_channel ‑> string list
Read all lines into a list.
val read_all : ?size:int ‑> Pervasives.in_channel ‑> string
Read the whole channel into a buffer, then converted into a string.
Parametersize: the internal buffer size.
Since: 0.7
val read_all_bytes : ?size:int ‑> Pervasives.in_channel ‑> Bytes.t
Read the whole channel into a mutable byte array.
Parametersize: the internal buffer size.
Since: 0.12
Output
val with_out : ?mode:int ‑> ?flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑>'a) ‑>'a
\ No newline at end of file
+CCIO (containers.CCIO)
Module CCIO
IO Utils
Simple utilities to deal with basic Input/Output tasks in a resource-safe way. For advanced IO tasks, the user is advised to use something like Lwt or Async, that are far more comprehensive.
Examples:
obtain the list of lines of a file:
# let l = CCIO.(with_in "/tmp/some_file" read_lines_l);;
transfer one file into another:
# CCIO.(
+ with_in "/tmp/input"
+ (fun ic ->
+ let chunks = read_chunks ic in
+ with_out ~flags:[Open_binary] ~mode:0o644 "/tmp/output"
+ (fun oc ->
+ write_gen oc chunks
+ )
+ )
+ ) ;;
since
0.6
before 0.12
was in 'containers.io', now moved into 'containers'
type 'a or_error = ('a, string) Result.result
type 'a gen = unit ->'a option
See Gen in the gen library.
Input
val with_in : ?mode:int -> ?flags:Pervasives.open_flag list -> string -> (Pervasives.in_channel ->'a) ->'a
Open 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 gen
Read the channel's content into chunks of size size.
val read_line : Pervasives.in_channel -> string option
Read 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 gen
Read all lines. The generator should be traversed only once.
val read_lines_l : Pervasives.in_channel -> string list
Read all lines into a list.
val read_all : ?size:int -> Pervasives.in_channel -> string
Read 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.t
Read 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) ->'a
\ No newline at end of file
diff --git a/dev/containers/CCInt/Infix/index.html b/dev/containers/CCInt/Infix/index.html
index b359cedf..99f1246a 100644
--- a/dev/containers/CCInt/Infix/index.html
+++ b/dev/containers/CCInt/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCInt.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCInt/index.html b/dev/containers/CCInt/index.html
index a36547a3..f312fa06 100644
--- a/dev/containers/CCInt/index.html
+++ b/dev/containers/CCInt/index.html
@@ -1,10 +1,2 @@
-CCInt (containers.CCInt)
pow 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.
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.
pow 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.
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.
\ No newline at end of file
diff --git a/dev/containers/CCInt32/Infix/index.html b/dev/containers/CCInt32/Infix/index.html
index df1e809f..e74e00c4 100644
--- a/dev/containers/CCInt32/Infix/index.html
+++ b/dev/containers/CCInt32/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCInt32.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCInt32/index.html b/dev/containers/CCInt32/index.html
index 3bf31545..4efb90e1 100644
--- a/dev/containers/CCInt32/index.html
+++ b/dev/containers/CCInt32/index.html
@@ -1,39 +1,2 @@
-CCInt32 (containers.CCInt32)
ModuleCCInt32
Int32
Helpers for 32-bit integers.
This module provides operations on the type int32 of signed 32-bit integers.
-Unlike the built-in int type, the type int32 is guaranteed to be exactly
-32-bit wide on all platforms. All arithmetic operations over int32 are taken
-modulo 232.
Performance notice: values of type int32 occupy more memory space than values
-of type int, and arithmetic operations on int32 are generally slower than
-those on int. Use int32 only when the application requires exact 32-bit arithmetic.
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 mod y is the integer remainder.
-If y <> zero, the result of x mod y satisfies the following property:
-x = ((x / y) * y) + (x mod y).
-If y = 0, x mod y raises Division_by_zero.
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 >= 32.
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 >= 32.
Convert the given 32-bit integer (type int32) to an
-integer (type int). On 32-bit platforms, the 32-bit integer
-is taken modulo 231, i.e. the high-order bit is lost
-during the conversion. On 64-bit platforms, the conversion is exact.
Alias to Int32.of_float.
-Convert the given floating-point number to a 32-bit integer,
-discarding the fractional part (truncate towards 0).
-The result of the conversion is undefined if, after truncation, the number
-is outside the range [CCInt32.min_int, CCInt32.max_int].
Alias to Int32.of_string.
-Convert the given string to a 32-bit integer.
-The string is read in decimal (by default, or if the string
-begins with 0u) or in hexadecimal, octal or binary if the
-string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range
-[0, 2*CCInt32.max_int+1]. If the input exceeds CCInt32.max_int
-it is converted to the signed integer
-CCInt32.min_int + input - CCInt32.max_int - 1.
The _ (underscore) character can appear anywhere in the string
-and is ignored.
-Raise Failure "Int32.of_string" if the given string is not
-a valid representation of an integer, or if the integer represented
-exceeds the range of integers representable in type int32.
\ No newline at end of file
+CCInt32 (containers.CCInt32)
Module CCInt32
Int32
Helpers for 32-bit integers.
This module provides operations on the type int32 of signed 32-bit integers. Unlike the built-in int type, the type int32 is guaranteed to be exactly 32-bit wide on all platforms. All arithmetic operations over int32 are taken modulo 232.
Performance notice: values of type int32 occupy more memory space than values of type int, and arithmetic operations on int32 are generally slower than those on int. Use int32 only when the application requires exact 32-bit arithmetic.
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 mod y is the integer remainder. If y <> zero, the result of x mod y satisfies the following property: x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
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 >= 32.
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 >= 32.
Convert the given 32-bit integer (type int32) to an integer (type int). On 32-bit platforms, the 32-bit integer is taken modulo 231, i.e. the high-order bit is lost during the conversion. On 64-bit platforms, the conversion is exact.
Alias to Int32.of_float. Convert the given floating-point number to a 32-bit integer, discarding the fractional part (truncate towards 0). The result of the conversion is undefined if, after truncation, the number is outside the range [CCInt32.min_int, CCInt32.max_int].
Alias to Int32.of_string. Convert the given string to a 32-bit integer. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt32.max_int+1]. If the input exceeds CCInt32.max_int it is converted to the signed integer CCInt32.min_int + input - CCInt32.max_int - 1.
The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int32.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int32.
\ No newline at end of file
diff --git a/dev/containers/CCInt64/Infix/index.html b/dev/containers/CCInt64/Infix/index.html
index f50f1a50..340f3719 100644
--- a/dev/containers/CCInt64/Infix/index.html
+++ b/dev/containers/CCInt64/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCInt64.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCInt64/index.html b/dev/containers/CCInt64/index.html
index ba969ec3..43106ad6 100644
--- a/dev/containers/CCInt64/index.html
+++ b/dev/containers/CCInt64/index.html
@@ -1,46 +1,2 @@
-CCInt64 (containers.CCInt64)
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 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
-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.
Convert 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
-is taken modulo 231, i.e. the top 33 bits are lost
-during the conversion.
Convert the given 64-bit integer (type int64) to a
-32-bit integer (type int32). The 64-bit integer
-is taken modulo 232, i.e. the top 32 bits are lost
-during the conversion.
Convert the given 64-bit integer (type int64) to a
-native integer. On 32-bit platforms, the 64-bit integer
-is taken modulo 232. On 64-bit platforms,
-the conversion is exact.
Alias to Int64.of_float.
-Convert the given floating-point number to a 64-bit integer,
-discarding the fractional part (truncate towards 0).
-The result of the conversion is undefined if, after truncation,
-the number is outside the range [CCInt64.min_int, CCInt64.max_int].
-NOTE: used to return an option, but the function never fails.
Alias to Int64.of_string.
-Convert the given string to a 64-bit integer.
-The string is read in decimal (by default, or if the string
-begins with 0u) or in hexadecimal, octal or binary if the
-string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range
-[0, 2*CCInt64.max_int+1]. If the input exceeds CCInt64.max_int
-it is converted to the signed integer
-CCInt64.min_int + input - CCInt64.max_int - 1.
The _ (underscore) character can appear anywhere in the string
-and is ignored.
-Raise Failure "Int64.of_string" if the given string is not
-a valid representation of an integer, or if the integer represented
-exceeds the range of integers representable in type int64.
\ No newline at end of file
+CCInt64 (containers.CCInt64)
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 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 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.
Convert 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 is taken modulo 231, i.e. the top 33 bits are lost during the conversion.
Convert the given 64-bit integer (type int64) to a 32-bit integer (type int32). The 64-bit integer is taken modulo 232, i.e. the top 32 bits are lost during the conversion.
Convert the given 64-bit integer (type int64) to a native integer. On 32-bit platforms, the 64-bit integer is taken modulo 232. On 64-bit platforms, the conversion is exact.
Alias to Int64.of_float. Convert the given floating-point number to a 64-bit integer, discarding the fractional part (truncate towards 0). The result of the conversion is undefined if, after truncation, the number is outside the range [CCInt64.min_int, CCInt64.max_int]. NOTE: used to return an option, but the function never fails.
Alias to Int64.of_string. Convert the given string to a 64-bit integer. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt64.max_int+1]. If the input exceeds CCInt64.max_int it is converted to the signed integer CCInt64.min_int + input - CCInt64.max_int - 1.
The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int64.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int64.
\ No newline at end of file
diff --git a/dev/containers/CCList/Assoc/index.html b/dev/containers/CCList/Assoc/index.html
index 7c33af60..d463a51a 100644
--- a/dev/containers/CCList/Assoc/index.html
+++ b/dev/containers/CCList/Assoc/index.html
@@ -1,4 +1,2 @@
-Assoc (containers.CCList.Assoc)
ModuleCCList.Assoc
type ('a, 'b) t = ('a * 'b) list
val get : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, 'b) t‑>'b option
Find the element.
val get_exn : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, 'b) t‑>'b
Like get, but unsafe.
RaisesNot_found: if the element is not present.
val set : eq:('a‑>'a‑> bool) ‑>'a‑>'b‑> ('a, 'b) t‑> ('a, 'b) t
Add the binding into the list (erase it if already present).
val mem : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, _) t‑> bool
mem x l returns true iff x is a key in l.
Since: 0.16
val update : eq:('a‑>'a‑> bool) ‑> f:('b option ‑>'b option) ‑>'a‑> ('a, 'b) t‑> ('a, 'b) t
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
val remove : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, 'b) t‑> ('a, 'b) t
remove x l removes the first occurrence of k from l.
Since: 0.17
\ No newline at end of file
+Assoc (containers.CCList.Assoc)
Module CCList.Assoc
type ('a, 'b) t = ('a * 'b) list
val get : eq:('a->'a-> bool) ->'a-> ('a, 'b) t->'b option
Find the element.
val get_exn : eq:('a->'a-> bool) ->'a-> ('a, 'b) t->'b
Like get, but unsafe.
raises Not_found
if the element is not present.
val set : eq:('a->'a-> bool) ->'a->'b-> ('a, 'b) t-> ('a, 'b) t
Add the binding into the list (erase it if already present).
val mem : eq:('a->'a-> bool) ->'a-> ('a, _) t-> bool
mem x l returns true iff x is a key in l.
since
0.16
val update : eq:('a->'a-> bool) -> f:('b option ->'b option) ->'a-> ('a, 'b) t-> ('a, 'b) t
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
val remove : eq:('a->'a-> bool) ->'a-> ('a, 'b) t-> ('a, 'b) t
remove x l removes the first occurrence of k from l.
since
0.17
\ No newline at end of file
diff --git a/dev/containers/CCList/Infix/index.html b/dev/containers/CCList/Infix/index.html
index 4ede567e..d9bc337f 100644
--- a/dev/containers/CCList/Infix/index.html
+++ b/dev/containers/CCList/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCList.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCList/Ref/index.html b/dev/containers/CCList/Ref/index.html
index 56413548..39dadcdb 100644
--- a/dev/containers/CCList/Ref/index.html
+++ b/dev/containers/CCList/Ref/index.html
@@ -1,3 +1,2 @@
-Ref (containers.CCList.Ref)
Add elements of the list at the beginning of the list ref. Elements at the end of the list will be at the beginning of the list ref.
\ No newline at end of file
diff --git a/dev/containers/CCList/Traverse/argument-1-M/index.html b/dev/containers/CCList/Traverse/argument-1-M/index.html
index 07caa0b7..465ec6fb 100644
--- a/dev/containers/CCList/Traverse/argument-1-M/index.html
+++ b/dev/containers/CCList/Traverse/argument-1-M/index.html
@@ -1,2 +1,2 @@
-1-M (containers.CCList.Traverse.1-M)
\ No newline at end of file
diff --git a/dev/containers/CCList/Traverse/index.html b/dev/containers/CCList/Traverse/index.html
index 5b32801a..1099d6e7 100644
--- a/dev/containers/CCList/Traverse/index.html
+++ b/dev/containers/CCList/Traverse/index.html
@@ -1,4 +1,2 @@
-Traverse (containers.CCList.Traverse)
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/dev/containers/CCList/index.html b/dev/containers/CCList/index.html
index 92938bf2..d5c82905 100644
--- a/dev/containers/CCList/index.html
+++ b/dev/containers/CCList/index.html
@@ -1,96 +1,6 @@
-CCList (containers.CCList)
ModuleCCList
Complements to list
type 'a sequence = ('a‑> unit) ‑> unit
type 'a gen = unit ‑>'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'aklist ]
type 'a printer = Format.formatter ‑>'a‑> unit
type 'a random_gen = Random.State.t ‑>'a
include module type of List
val length : 'a list ‑> int
val compare_lengths : 'a list ‑>'b list ‑> int
val compare_length_with : 'a list ‑> int ‑> int
val cons : 'a‑>'a list ‑>'a list
val hd : 'a list ‑>'a
val tl : 'a list ‑>'a list
val nth : 'a list ‑> int ‑>'a
val nth_opt : 'a list ‑> int ‑>'a option
val rev : 'a list ‑>'a list
val init : int ‑> (int ‑>'a) ‑>'a list
val append : 'a list ‑>'a list ‑>'a list
val rev_append : 'a list ‑>'a list ‑>'a list
val concat : 'a list list ‑>'a list
val flatten : 'a list list ‑>'a list
val iter : ('a‑> unit) ‑>'a list ‑> unit
val iteri : (int ‑>'a‑> unit) ‑>'a list ‑> unit
val map : ('a‑>'b) ‑>'a list ‑>'b list
val mapi : (int ‑>'a‑>'b) ‑>'a list ‑>'b list
val rev_map : ('a‑>'b) ‑>'a list ‑>'b list
val fold_left : ('a‑>'b‑>'a) ‑>'a‑>'b list ‑>'a
val fold_right : ('a‑>'b‑>'b) ‑>'a list ‑>'b‑>'b
val iter2 : ('a‑>'b‑> unit) ‑>'a list ‑>'b list ‑> unit
val map2 : ('a‑>'b‑>'c) ‑>'a list ‑>'b list ‑>'c list
val rev_map2 : ('a‑>'b‑>'c) ‑>'a list ‑>'b list ‑>'c list
val fold_left2 : ('a‑>'b‑>'c‑>'a) ‑>'a‑>'b list ‑>'c list ‑>'a
val fold_right2 : ('a‑>'b‑>'c‑>'c) ‑>'a list ‑>'b list ‑>'c‑>'c
val for_all : ('a‑> bool) ‑>'a list ‑> bool
val exists : ('a‑> bool) ‑>'a list ‑> bool
val for_all2 : ('a‑>'b‑> bool) ‑>'a list ‑>'b list ‑> bool
val exists2 : ('a‑>'b‑> bool) ‑>'a list ‑>'b list ‑> bool
val mem : 'a‑>'a list ‑> bool
val memq : 'a‑>'a list ‑> bool
val find : ('a‑> bool) ‑>'a list ‑>'a
val find_opt : ('a‑> bool) ‑>'a list ‑>'a option
val filter : ('a‑> bool) ‑>'a list ‑>'a list
val find_all : ('a‑> bool) ‑>'a list ‑>'a list
val partition : ('a‑> bool) ‑>'a list ‑>'a list * 'a list
val assoc : 'a‑> ('a * 'b) list ‑>'b
val assoc_opt : 'a‑> ('a * 'b) list ‑>'b option
val assq : 'a‑> ('a * 'b) list ‑>'b
val assq_opt : 'a‑> ('a * 'b) list ‑>'b option
val mem_assoc : 'a‑> ('a * 'b) list ‑> bool
val mem_assq : 'a‑> ('a * 'b) list ‑> bool
val remove_assoc : 'a‑> ('a * 'b) list ‑> ('a * 'b) list
val remove_assq : 'a‑> ('a * 'b) list ‑> ('a * 'b) list
val split : ('a * 'b) list ‑>'a list * 'b list
val combine : 'a list ‑>'b list ‑> ('a * 'b) list
val sort : ('a‑>'a‑> int) ‑>'a list ‑>'a list
val stable_sort : ('a‑>'a‑> int) ‑>'a list ‑>'a list
val fast_sort : ('a‑>'a‑> int) ‑>'a list ‑>'a list
val sort_uniq : ('a‑>'a‑> int) ‑>'a list ‑>'a list
val merge : ('a‑>'a‑> int) ‑>'a list ‑>'a list ‑>'a 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
-in the input list is preserved.
Like List.combine but tail-recursive.
-Transform a pair of lists into a list of pairs:
-combine [a1; ...; an] [b1; ...; bn] is
-[(a1,b1); ...; (an,bn)].
RaisesInvalid_argument: if the lists have distinct lengths.
Since: 1.2
val combine_gen : 'a list ‑>'b list ‑> ('a * 'b) gen
Lazy version of combine.
-Unlike combine, it does not fail if the lists have different
-lengths;
-instead, the output has as many pairs as the smallest input list.
A tail-recursive version of List.split.
-Transform a list of pairs into a pair of lists:
-split [(a1,b1); ...; (an,bn)] is ([a1; ...; an], [b1; ...; bn]).
Produce the cartesian product of this list of lists,
-by returning all the ways of picking one element per sublist.
-NOTE the order of the returned list is unspecified.
-For example:
-
-invariant: cartesian_product l = map_product id l.
Since: 1.2
val map_product_l : ('a‑>'b list) ‑>'a list ‑>'b list list
map_product_l f l maps each element of l to a list of
-objects of type 'b using f.
-We obtain [l1;l2;...;ln] where length l=n and li : 'b list.
-Then, it returns all the ways of picking exactly one element per li.
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 : ('a‑> [< `Left of 'b | `Right of 'c | `Drop ]) ‑>'a list ‑>'b list * 'c list
partition_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 ‑> int ‑>'a list ‑>'a list list
sublists_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].
Parameteroffset: the number of elements skipped between two consecutive
-sub-lists. By default it is n. If offset < n, the sub-lists
-will overlap; if offset > n, some elements will not appear at all.
Parameterlast: if provided and the last group of elements g is such
-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.
RaisesInvalid_argument: if offset <= 0 or n <= 0.
Since: 1.0
val intersperse : 'a‑>'a list ‑>'a list
Insert the first argument between every element of the list
Since: 2.1
val interleave : 'a list ‑>'a list ‑>'a list
interleave [x1…xn] [y1…ym] is x1,y1,x2,y2,… and finishes with
-the suffix of the longest list
Set i-th element (removes the old one), or does nothing if
-index is too high.
-If the index is negative, it will set element starting from the end
-of the list.
Insert at i-th position, between the two existing elements. If the
-index is too high, append at the end of the list.
-If the index is negative, it will insert element starting from the end
-of the list.
Remove element at given index. Does nothing if the index is
-too high.
-If the index is negative, it will remove element starting from the end
-of the list.
Set Operators
Those operations maintain the invariant that the list does not
-contain duplicates (if it already satisfies it).
Remove duplicates w.r.t the equality predicate.
-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.
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.
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.
Like List.combine but tail-recursive. Transform a pair of lists into a list of pairs: combine [a1; ...; an] [b1; ...; bn] is [(a1,b1); ...; (an,bn)].
raises Invalid_argument
if the lists have distinct lengths.
since
1.2, but only
since
2.2 with labels
val combine_gen : 'a list ->'b list -> ('a * 'b) gen
Lazy version of combine. Unlike combine, it does not fail if the lists have different lengths; instead, the output has as many pairs as the smallest input list.
A tail-recursive version of List.split. Transform a list of pairs into a pair of lists: split [(a1,b1); ...; (an,bn)] is ([a1; ...; an], [b1; ...; bn]).
Produce the cartesian product of this list of lists, by returning all the ways of picking one element per sublist. NOTE the order of the returned list is unspecified. For example:
invariant: cartesian_product l = map_product id l.
since
1.2, but only
since
2.2 with labels
val map_product_l : ('a->'b list) ->'a list ->'b list list
map_product_l f l maps each element of l to a list of objects of type 'b using f. We obtain [l1;l2;...;ln] where length l=n and li : 'b list. Then, it returns all the ways of picking exactly one element per li.
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 : ('a-> [< `Left of 'b | `Right of 'c | `Drop ]) ->'a list ->'b list * 'c list
partition_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 group_by : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at->'a list t
Group equal elements, regardless of their order of appearance. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
2.3
val join : join_row:('a->'b->'c option) ->'at->'bt->'ct
join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.
join key1 key2 ~merge is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
2.3
val join_all_by : ?eq:('key->'key-> bool) -> ?hash:('key-> int) -> ('a->'key) -> ('b->'key) -> merge:('key->'a list ->'b list ->'c option) ->'at->'bt->'ct
join_all_by key1 key2 ~merge is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:
compute the list l1 of elements of a that map to k
compute the list l2 of elements of b that map to k
call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
2.3
val group_join_by : ?eq:('a->'a-> bool) -> ?hash:('a-> int) -> ('b->'a) ->'at->'bt-> ('a * 'b list) t
group_join_by key2 associates to every element x of the first sequence, all the elements y of the second sequence such that eq x (key y). Elements of the first sequences without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
2.3
val sublists_of_len : ?last:('a list ->'a list option) -> ?offset:int -> int ->'a list ->'a list list
sublists_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].
the number of elements skipped between two consecutive sub-lists. By default it is n. If offset < n, the sub-lists will overlap; if offset > n, some elements will not appear at all.
parameter last
if provided and the last group of elements g is such 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.
Set i-th element (removes the old one), or does nothing if index is too high. If the index is negative, it will set element starting from the end of the list.
Insert at i-th position, between the two existing elements. If the index is too high, append at the end of the list. If the index is negative, it will insert element starting from the end of the list.
Remove element at given index. Does nothing if the index is too high. If the index is negative, it will remove element starting from the end of the list.
Set Operators
Those operations maintain the invariant that the list does not contain duplicates (if it already satisfies it).
Remove duplicates w.r.t the equality predicate. 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.
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.
val pp : ?start:string -> ?stop:string -> ?sep:string ->'aprinter->'atprinter
Print the contents of a list.
\ No newline at end of file
diff --git a/dev/containers/CCList/module-type-MONAD/index.html b/dev/containers/CCList/module-type-MONAD/index.html
index 732eec61..0f47f52b 100644
--- a/dev/containers/CCList/module-type-MONAD/index.html
+++ b/dev/containers/CCList/module-type-MONAD/index.html
@@ -1,2 +1,2 @@
-MONAD (containers.CCList.MONAD)
\ No newline at end of file
diff --git a/dev/containers/CCListLabels/Assoc/index.html b/dev/containers/CCListLabels/Assoc/index.html
index 03850fd6..b863148e 100644
--- a/dev/containers/CCListLabels/Assoc/index.html
+++ b/dev/containers/CCListLabels/Assoc/index.html
@@ -1,4 +1,2 @@
-Assoc (containers.CCListLabels.Assoc)
ModuleCCListLabels.Assoc
type ('a, 'b) t = ('a * 'b) list
val get : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, 'b) t‑>'b option
Find the element.
val get_exn : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, 'b) t‑>'b
Like get, but unsafe.
RaisesNot_found: if the element is not present.
val set : eq:('a‑>'a‑> bool) ‑>'a‑>'b‑> ('a, 'b) t‑> ('a, 'b) t
Add the binding into the list (erase it if already present).
val mem : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, _) t‑> bool
mem x l returns true iff x is a key in l.
Since: 0.16
val update : eq:('a‑>'a‑> bool) ‑> f:('b option ‑>'b option) ‑>'a‑> ('a, 'b) t‑> ('a, 'b) t
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
val remove : eq:('a‑>'a‑> bool) ‑>'a‑> ('a, 'b) t‑> ('a, 'b) t
remove x l removes the first occurrence of k from l.
Since: 0.17
\ No newline at end of file
+Assoc (containers.CCListLabels.Assoc)
Module CCListLabels.Assoc
type ('a, 'b) t = ('a * 'b) list
val get : eq:('a->'a-> bool) ->'a-> ('a, 'b) t->'b option
Find the element.
val get_exn : eq:('a->'a-> bool) ->'a-> ('a, 'b) t->'b
Like get, but unsafe.
raises Not_found
if the element is not present.
val set : eq:('a->'a-> bool) ->'a->'b-> ('a, 'b) t-> ('a, 'b) t
Add the binding into the list (erase it if already present).
val mem : eq:('a->'a-> bool) ->'a-> ('a, _) t-> bool
mem x l returns true iff x is a key in l.
since
0.16
val update : eq:('a->'a-> bool) -> f:('b option ->'b option) ->'a-> ('a, 'b) t-> ('a, 'b) t
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
val remove : eq:('a->'a-> bool) ->'a-> ('a, 'b) t-> ('a, 'b) t
remove x l removes the first occurrence of k from l.
since
0.17
\ No newline at end of file
diff --git a/dev/containers/CCListLabels/Infix/index.html b/dev/containers/CCListLabels/Infix/index.html
index db928795..a476e811 100644
--- a/dev/containers/CCListLabels/Infix/index.html
+++ b/dev/containers/CCListLabels/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCListLabels.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCListLabels/Ref/index.html b/dev/containers/CCListLabels/Ref/index.html
index 0d34dd03..6800d63f 100644
--- a/dev/containers/CCListLabels/Ref/index.html
+++ b/dev/containers/CCListLabels/Ref/index.html
@@ -1,3 +1,2 @@
-Ref (containers.CCListLabels.Ref)
Add elements of the list at the beginning of the list ref. Elements at the end of the list will be at the beginning of the list ref.
\ No newline at end of file
diff --git a/dev/containers/CCListLabels/Traverse/argument-1-M/index.html b/dev/containers/CCListLabels/Traverse/argument-1-M/index.html
index 4d3ab9eb..65e681cf 100644
--- a/dev/containers/CCListLabels/Traverse/argument-1-M/index.html
+++ b/dev/containers/CCListLabels/Traverse/argument-1-M/index.html
@@ -1,2 +1,2 @@
-1-M (containers.CCListLabels.Traverse.1-M)
\ No newline at end of file
diff --git a/dev/containers/CCListLabels/Traverse/index.html b/dev/containers/CCListLabels/Traverse/index.html
index e8fbf9d2..f2e38b53 100644
--- a/dev/containers/CCListLabels/Traverse/index.html
+++ b/dev/containers/CCListLabels/Traverse/index.html
@@ -1,4 +1,2 @@
-Traverse (containers.CCListLabels.Traverse)
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/dev/containers/CCListLabels/index.html b/dev/containers/CCListLabels/index.html
index be35c37d..8322b385 100644
--- a/dev/containers/CCListLabels/index.html
+++ b/dev/containers/CCListLabels/index.html
@@ -1,60 +1,6 @@
-CCListLabels (containers.CCListLabels)
ModuleCCListLabels
Complements to list
include module type of ListLabels
val length : 'a list ‑> int
val hd : 'a list ‑>'a
val compare_lengths : 'a list ‑>'b list ‑> int
val compare_length_with : 'a list ‑> len:int ‑> int
val cons : 'a‑>'a list ‑>'a list
val tl : 'a list ‑>'a list
val nth : 'a list ‑> int ‑>'a
val nth_opt : 'a list ‑> int ‑>'a option
val rev : 'a list ‑>'a list
val init : len:int ‑> f:(int ‑>'a) ‑>'a list
val append : 'a list ‑>'a list ‑>'a list
val rev_append : 'a list ‑>'a list ‑>'a list
val concat : 'a list list ‑>'a list
val flatten : 'a list list ‑>'a list
val iter : f:('a‑> unit) ‑>'a list ‑> unit
val iteri : f:(int ‑>'a‑> unit) ‑>'a list ‑> unit
val map : f:('a‑>'b) ‑>'a list ‑>'b list
val mapi : f:(int ‑>'a‑>'b) ‑>'a list ‑>'b list
val rev_map : f:('a‑>'b) ‑>'a list ‑>'b list
val fold_left : f:('a‑>'b‑>'a) ‑> init:'a‑>'b list ‑>'a
val fold_right : f:('a‑>'b‑>'b) ‑>'a list ‑> init:'b‑>'b
val iter2 : f:('a‑>'b‑> unit) ‑>'a list ‑>'b list ‑> unit
val map2 : f:('a‑>'b‑>'c) ‑>'a list ‑>'b list ‑>'c list
val rev_map2 : f:('a‑>'b‑>'c) ‑>'a list ‑>'b list ‑>'c list
val fold_left2 : f:('a‑>'b‑>'c‑>'a) ‑> init:'a‑>'b list ‑>'c list ‑>'a
val fold_right2 : f:('a‑>'b‑>'c‑>'c) ‑>'a list ‑>'b list ‑> init:'c‑>'c
val for_all : f:('a‑> bool) ‑>'a list ‑> bool
val exists : f:('a‑> bool) ‑>'a list ‑> bool
val for_all2 : f:('a‑>'b‑> bool) ‑>'a list ‑>'b list ‑> bool
val exists2 : f:('a‑>'b‑> bool) ‑>'a list ‑>'b list ‑> bool
val mem : 'a‑> set:'a list ‑> bool
val memq : 'a‑> set:'a list ‑> bool
val find : f:('a‑> bool) ‑>'a list ‑>'a
val find_opt : f:('a‑> bool) ‑>'a list ‑>'a option
val filter : f:('a‑> bool) ‑>'a list ‑>'a list
val find_all : f:('a‑> bool) ‑>'a list ‑>'a list
val partition : f:('a‑> bool) ‑>'a list ‑>'a list * 'a list
val assoc : 'a‑> ('a * 'b) list ‑>'b
val assoc_opt : 'a‑> ('a * 'b) list ‑>'b option
val assq : 'a‑> ('a * 'b) list ‑>'b
val assq_opt : 'a‑> ('a * 'b) list ‑>'b option
val mem_assoc : 'a‑> map:('a * 'b) list ‑> bool
val mem_assq : 'a‑> map:('a * 'b) list ‑> bool
val remove_assoc : 'a‑> ('a * 'b) list ‑> ('a * 'b) list
val remove_assq : 'a‑> ('a * 'b) list ‑> ('a * 'b) list
val split : ('a * 'b) list ‑>'a list * 'b list
val combine : 'a list ‑>'b list ‑> ('a * 'b) list
val sort : cmp:('a‑>'a‑> int) ‑>'a list ‑>'a list
val stable_sort : cmp:('a‑>'a‑> int) ‑>'a list ‑>'a list
val fast_sort : cmp:('a‑>'a‑> int) ‑>'a list ‑>'a list
val sort_uniq : cmp:('a‑>'a‑> int) ‑>'a list ‑>'a list
val merge : cmp:('a‑>'a‑> int) ‑>'a list ‑>'a list ‑>'a 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
-in the input list is preserved.
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 list
partition_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 list
sublists_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].
find_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) ‑>'at‑>'b option
Like find_map, but also pass the index to the predicate function.
Since: 0.11
val find_idx : f:('a‑> bool) ‑>'at‑> (int * 'a) option
find_idx p x returns Some (i,x) where x is the i-th element of l,
-and p x holds. Otherwise returns None.
val remove : eq:('a‑>'a‑> bool) ‑> key:'a‑>'at‑>'at
remove ~key l removes every instance of key from l. Tail-recursive.
Set i-th element (removes the old one), or does nothing if
-index is too high.
-If the index is negative, it will set element starting from the end
-of the list.
Insert at i-th position, between the two existing elements. If the
-index is too high, append at the end of the list.
-If the index is negative, it will insert element starting from the end
-of the list.
Remove element at given index. Does nothing if the index is
-too high.
-If the index is negative, it will remove element starting from the end
-of the list.
Set Operators
Those operations maintain the invariant that the list does not
-contain duplicates (if it already satisfies it).
Remove duplicates w.r.t the equality predicate.
-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.
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.
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 : f:('a->'b->'b) ->'at-> init:'b->'b
Safe version of fold_right. fold_right f [a1; ...; an] b is f a1 (f a2 (... (f an b) ...)).
Like List.combine but tail-recursive. Transform a pair of lists into a list of pairs: combine [a1; ...; an] [b1; ...; bn] is [(a1,b1); ...; (an,bn)].
raises Invalid_argument
if the lists have distinct lengths.
since
1.2, but only
since
2.2 with labels
val combine_gen : 'a list ->'b list -> ('a * 'b) gen
Lazy version of combine. Unlike combine, it does not fail if the lists have different lengths; instead, the output has as many pairs as the smallest input list.
A tail-recursive version of List.split. Transform a list of pairs into a pair of lists: split [(a1,b1); ...; (an,bn)] is ([a1; ...; an], [b1; ...; bn]).
Produce the cartesian product of this list of lists, by returning all the ways of picking one element per sublist. NOTE the order of the returned list is unspecified. For example:
invariant: cartesian_product l = map_product id l.
since
1.2, but only
since
2.2 with labels
val map_product_l : f:('a->'b list) ->'a list ->'b list list
map_product_l f l maps each element of l to a list of objects of type 'b using f. We obtain [l1;l2;...;ln] where length l=n and li : 'b list. Then, it returns all the ways of picking exactly one element per li.
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 list
partition_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 group_by : ?hash:('a-> int) -> ?eq:('a->'a-> bool) ->'at->'a list t
Group equal elements, regardless of their order of appearance. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
2.3
val join : join_row:('a->'b->'c option) ->'at->'bt->'ct
join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.
join key1 key2 ~merge is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
2.3
val join_all_by : ?eq:('key->'key-> bool) -> ?hash:('key-> int) -> ('a->'key) -> ('b->'key) -> merge:('key->'a list ->'b list ->'c option) ->'at->'bt->'ct
join_all_by key1 key2 ~merge is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:
compute the list l1 of elements of a that map to k
compute the list l2 of elements of b that map to k
call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
2.3
val group_join_by : ?eq:('a->'a-> bool) -> ?hash:('a-> int) -> ('b->'a) ->'at->'bt-> ('a * 'b list) t
group_join_by key2 associates to every element x of the first sequence, all the elements y of the second sequence such that eq x (key y). Elements of the first sequences without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.
since
2.3
val sublists_of_len : ?last:('a list ->'a list option) -> ?offset:int -> len:int ->'a list ->'a list list
sublists_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].
the number of elements skipped between two consecutive sub-lists. By default it is n. If offset < n, the sub-lists will overlap; if offset > n, some elements will not appear at all.
parameter last
if provided and the last group of elements g is such 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.
Set i-th element (removes the old one), or does nothing if index is too high. If the index is negative, it will set element starting from the end of the list.
Insert at i-th position, between the two existing elements. If the index is too high, append at the end of the list. If the index is negative, it will insert element starting from the end of the list.
Remove element at given index. Does nothing if the index is too high. If the index is negative, it will remove element starting from the end of the list.
Set Operators
Those operations maintain the invariant that the list does not contain duplicates (if it already satisfies it).
Remove duplicates w.r.t the equality predicate. 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.
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.
val pp : ?start:string -> ?stop:string -> ?sep:string ->'aprinter->'atprinter
Print the contents of a list.
\ No newline at end of file
diff --git a/dev/containers/CCListLabels/module-type-MONAD/index.html b/dev/containers/CCListLabels/module-type-MONAD/index.html
index c74a4bba..f5bf114c 100644
--- a/dev/containers/CCListLabels/module-type-MONAD/index.html
+++ b/dev/containers/CCListLabels/module-type-MONAD/index.html
@@ -1,2 +1,2 @@
-MONAD (containers.CCListLabels.MONAD)
\ No newline at end of file
diff --git a/dev/containers/CCMap/index.html b/dev/containers/CCMap/index.html
index d5ee9cc9..a5c3e6f1 100644
--- a/dev/containers/CCMap/index.html
+++ b/dev/containers/CCMap/index.html
@@ -1,2 +1,2 @@
-CCMap (containers.CCMap)
module Make : functor (O : Map.OrderedType) ->Swithtype 'a Make.t = 'a Map.Make(O).t andtypeMake.key = O.t
\ No newline at end of file
diff --git a/dev/containers/CCMap/module-type-S/index.html b/dev/containers/CCMap/module-type-S/index.html
index 7b263117..a99cc629 100644
--- a/dev/containers/CCMap/module-type-S/index.html
+++ b/dev/containers/CCMap/module-type-S/index.html
@@ -1,10 +1,2 @@
-S (containers.CCMap.S)
get_or k m ~default returns the value associated to k if present,
-and returns default otherwise (if k doesn't belong in m).
Since: 0.16
val update : key‑> ('a option ‑>'a option) ‑>'at‑>'at
update k f m calls f (Some v) if find k m = v,
-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.
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.
get_or k m ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in m).
since
0.16
val update : key-> ('a option ->'a option) ->'at->'at
update k f m calls f (Some v) if find k m = v, 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.
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/dev/containers/CCNativeint/Infix/index.html b/dev/containers/CCNativeint/Infix/index.html
index 48c1b56c..78750191 100644
--- a/dev/containers/CCNativeint/Infix/index.html
+++ b/dev/containers/CCNativeint/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCNativeint.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCNativeint/index.html b/dev/containers/CCNativeint/index.html
index 57ac31f8..3890d47f 100644
--- a/dev/containers/CCNativeint/index.html
+++ b/dev/containers/CCNativeint/index.html
@@ -1,40 +1,2 @@
-CCNativeint (containers.CCNativeint)
ModuleCCNativeint
Nativeint
Helpers for processor-native integers
This module provides operations on the type nativeint of signed 32-bit integers
-(on 32-bit platforms) or signed 64-bit integers (on 64-bit platforms).
-This integer type has exactly the same width as that of a pointer type in the C compiler.
-All arithmetic operations over nativeint are taken modulo 232 or 264 depending
-on the word size of the architecture.
Performance notice: values of type nativeint occupy more memory space than values of type int,
-and arithmetic operations on nativeint are generally slower than those on int.
-Use nativeint only when the application requires the extra bit of precision over the int type.
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 mod y is the integer remainder.
-If y <> zero, the result of x mod y satisfies the following properties:
-zero <= x mod y < abs y and
-x = ((x / y) * y) + (x mod y).
-If y = 0, x mod y raises Division_by_zero.
x lsl y shifts x to the left by y bits.
-The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform
-and 64 on a 64-bit platform.
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 >= bitsize.
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 >= bitsize.
Alias to Nativeint.of_float.
-Convert the given floating-point number to a native integer,
-discarding the fractional part (truncate towards 0).
-The result of the conversion is undefined if, after truncation, the number
-is outside the range [CCNativeint.min_int, CCNativeint.max_int].
Alias to Nativeint.of_string.
-Convert the given string to a native integer.
-The string is read in decimal (by default, or if the string
-begins with 0u) or in hexadecimal, octal or binary if the
-string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range
-[0, 2*CCNativeint.max_int+1]. If the input exceeds CCNativeint.max_int
-it is converted to the signed integer
-CCInt64.min_int + input - CCNativeint.max_int - 1.
Raise Failure "Nativeint.of_string" if the given string is not
-a valid representation of an integer, or if the integer represented
-exceeds the range of integers representable in type nativeint.
\ No newline at end of file
+CCNativeint (containers.CCNativeint)
Module CCNativeint
Nativeint
Helpers for processor-native integers
This module provides operations on the type nativeint of signed 32-bit integers (on 32-bit platforms) or signed 64-bit integers (on 64-bit platforms). This integer type has exactly the same width as that of a pointer type in the C compiler. All arithmetic operations over nativeint are taken modulo 232 or 264 depending on the word size of the architecture.
Performance notice: values of type nativeint occupy more memory space than values of type int, and arithmetic operations on nativeint are generally slower than those on int. Use nativeint only when the application requires the extra bit of precision over the int type.
since
2.1
includemoduletypeofsig ... end
val zero : nativeint
val one : nativeint
val minus_one : nativeint
val neg : nativeint -> nativeint
val add : nativeint -> nativeint -> nativeint
val sub : nativeint -> nativeint -> nativeint
val mul : nativeint -> nativeint -> nativeint
val div : nativeint -> nativeint -> nativeint
val rem : nativeint -> nativeint -> nativeint
val succ : nativeint -> nativeint
val pred : nativeint -> nativeint
val abs : nativeint -> nativeint
val size : int
val max_int : nativeint
val min_int : nativeint
val logand : nativeint -> nativeint -> nativeint
val logor : nativeint -> nativeint -> nativeint
val logxor : nativeint -> nativeint -> nativeint
val lognot : nativeint -> nativeint
val shift_left : nativeint -> int -> nativeint
val shift_right : nativeint -> int -> nativeint
val shift_right_logical : nativeint -> int -> nativeint
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 mod y is the integer remainder. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
x lsl y shifts x to the left by y bits. The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform and 64 on a 64-bit platform.
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 >= bitsize.
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 >= bitsize.
Alias to Nativeint.of_float. Convert the given floating-point number to a native integer, discarding the fractional part (truncate towards 0). The result of the conversion is undefined if, after truncation, the number is outside the range [CCNativeint.min_int, CCNativeint.max_int].
Alias to Nativeint.of_string. Convert the given string to a native integer. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCNativeint.max_int+1]. If the input exceeds CCNativeint.max_int it is converted to the signed integer CCInt64.min_int + input - CCNativeint.max_int - 1.
Raise Failure "Nativeint.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type nativeint.
\ No newline at end of file
diff --git a/dev/containers/CCOpt/Infix/index.html b/dev/containers/CCOpt/Infix/index.html
index ef52846b..9e7629ed 100644
--- a/dev/containers/CCOpt/Infix/index.html
+++ b/dev/containers/CCOpt/Infix/index.html
@@ -1,2 +1,2 @@
-Infix (containers.CCOpt.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCOpt/index.html b/dev/containers/CCOpt/index.html
index 851cd7dc..294ad56d 100644
--- a/dev/containers/CCOpt/index.html
+++ b/dev/containers/CCOpt/index.html
@@ -1,10 +1,2 @@
-CCOpt (containers.CCOpt)
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 option
wrap 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.
Parameterhandler: the exception handler, which returns true if the
-exception is to be caught.
val wrap2 : ?handler:(exn ‑> bool) ‑> ('a‑>'b‑>'c) ‑>'a‑>'b‑>'c option
wrap2 f x y is similar to wrap but for binary functions.
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 option
wrap 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 option
wrap2 f x y is similar to wrap but for binary functions.
\ No newline at end of file
diff --git a/dev/containers/CCOrd/Infix/index.html b/dev/containers/CCOrd/Infix/index.html
index 518312f2..c8488e04 100644
--- a/dev/containers/CCOrd/Infix/index.html
+++ b/dev/containers/CCOrd/Infix/index.html
@@ -1,4 +1,2 @@
-Infix (containers.CCOrd.Infix)
\ No newline at end of file
diff --git a/dev/containers/CCOrd/index.html b/dev/containers/CCOrd/index.html
index bf28fcc5..fd188628 100644
--- a/dev/containers/CCOrd/index.html
+++ b/dev/containers/CCOrd/index.html
@@ -1,15 +1,6 @@
-CCOrd (containers.CCOrd)
ModuleCCOrd
Comparisons
type 'a t = 'a‑>'a‑> int
Comparison (total ordering) between two elements, that returns an int.
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.
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.
\ No newline at end of file
diff --git a/dev/containers/CCPair/index.html b/dev/containers/CCPair/index.html
index e236b9aa..819a637d 100644
--- a/dev/containers/CCPair/index.html
+++ b/dev/containers/CCPair/index.html
@@ -1,4 +1,2 @@
-CCPair (containers.CCPair)
Print a pair given an optional separator and a method for printing each of its elements.
\ No newline at end of file
diff --git a/dev/containers/CCParse/Infix/index.html b/dev/containers/CCParse/Infix/index.html
index 2db2c0dc..f0b62512 100644
--- a/dev/containers/CCParse/Infix/index.html
+++ b/dev/containers/CCParse/Infix/index.html
@@ -1,13 +1,2 @@
-Infix (containers.CCParse.Infix)
a <|> b tries to parse a, and if a fails without
-consuming any input, backtracks and tries
-to parse b, otherwise it fails as a.
-See try_ to ensure a does not consume anything (but it is best
-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".
\ No newline at end of file
+Infix (containers.CCParse.Infix)
a <|> b tries to parse a, and if a fails without consuming any input, backtracks and tries to parse b, otherwise it fails as a. See try_ to ensure a does not consume anything (but it is best 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".
\ No newline at end of file
diff --git a/dev/containers/CCParse/U/index.html b/dev/containers/CCParse/U/index.html
index 317eebba..02741176 100644
--- a/dev/containers/CCParse/U/index.html
+++ b/dev/containers/CCParse/U/index.html
@@ -1,6 +1,2 @@
-U (containers.CCParse.U)
ModuleCCParse.U
val list : ?start:string ‑> ?stop:string ‑> ?sep:string ‑>'at‑>'a list t
list p parses a list of p, with the OCaml conventions for
-start token "", stop token "" and separator ";".
-Whitespace between items are skipped.
val pair : ?start:string -> ?stop:string -> ?sep:string ->'at->'bt-> ('a * 'b) t
Parse a pair using OCaml whitespace conventions. The default is "(a, b)".
val triple : ?start:string -> ?stop:string -> ?sep:string ->'at->'bt->'ct-> ('a * 'b * 'c) t
Parse a triple using OCaml whitespace conventions. The default is "(a, b, c)".
\ No newline at end of file
diff --git a/dev/containers/CCParse/index.html b/dev/containers/CCParse/index.html
index 83bcba9e..69393570 100644
--- a/dev/containers/CCParse/index.html
+++ b/dev/containers/CCParse/index.html
@@ -1,51 +1,27 @@
-CCParse (containers.CCParse)
ModuleCCParse
Very Simple Parser Combinators
open CCParse;;
+CCParse (containers.CCParse)
Module CCParse
Very Simple Parser Combinators
open CCParse;;
- type tree = L of int | N of tree * tree;;
+type tree = L of int | N of tree * tree;;
- let mk_leaf x = L x
- let mk_node x y = N(x,y)
+let mk_leaf x = L x
+let mk_node x y = N(x,y)
- let ptree = fix @@ fun self ->
- skip_space *>
- ( (try_ (char '(') *> (pure mk_node <*> self <*> self) <* char ')')
- <|>
- (U.int >|= mk_leaf) )
- ;;
+let ptree = fix @@ fun self ->
+ skip_space *>
+ ( (try_ (char '(') *> (pure mk_node <*> self <*> self) <* char ')')
+ <|>
+ (U.int >|= mk_leaf) )
+;;
- parse_string_exn ptree "(1 (2 3))" ;;
- parse_string_exn ptree "((1 2) (3 (4 5)))" ;;
-
Parse a list of words
open Containers.Parse;;
- let p = U.list ~sep:"," U.word;;
- parse_string_exn p "[abc , de, hello ,world ]";;
Stress Test
-This makes a list of 100_000 integers, prints it and parses it back.
let p = CCParse.(U.list ~sep:"," U.int);;
+parse_string_exn ptree "(1 (2 3))" ;;
+parse_string_exn ptree "((1 2) (3 (4 5)))" ;;
Parse a list of words
open Containers.Parse;;
+let p = U.list ~sep:"," U.word;;
+parse_string_exn p "[abc , de, hello ,world ]";;
Stress Test
This makes a list of 100_000 integers, prints it and parses it back.
let p = CCParse.(U.list ~sep:"," U.int);;
- let l = CCList.(1 -- 100_000);;
- let l_printed =
- CCFormat.(to_string (within "[" "]" (list ~sep:(return ",@,") int))) l;;
+let l = CCList.(1 -- 100_000);;
+let l_printed =
+ CCFormat.(to_string (within "[" "]" (list ~sep:(return ",@,") int))) l;;
- let l' = CCParse.parse_string_exn p l_printed;;
+let l' = CCParse.parse_string_exn p l_printed;;
- assert (l=l');;
a <|> b tries to parse a, and if a fails without
-consuming any input, backtracks and tries
-to parse b, otherwise it fails as a.
-See try_ to ensure a does not consume anything (but it is best
-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.
a <|> b tries to parse a, and if a fails without consuming any input, backtracks and tries to parse b, otherwise it fails as a. See try_ to ensure a does not consume anything (but it is best 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.
\ No newline at end of file
diff --git a/dev/containers/CCRandom/index.html b/dev/containers/CCRandom/index.html
index bd38ff55..5799fc3c 100644
--- a/dev/containers/CCRandom/index.html
+++ b/dev/containers/CCRandom/index.html
@@ -1,23 +1,7 @@
-CCRandom (containers.CCRandom)
replicate n g makes a list of n elements which are all generated
-randomly using g.
val sample_without_replacement : compare:('a‑>'a‑> int) ‑> int ‑>'at‑>'a list t
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.
retry g calls g until it returns some value, or until the maximum
-number of retries was reached. If g fails,
-then it counts for one iteration, and the generator retries.
Parametermax: : maximum number of retries. Default 10.
val try_successively : 'a option t list ‑>'a option t
try_successively l tries each generator of l, one after the other.
-If some generator succeeds its result is returned, else the
-next generator is tried.
a <?> b is a choice operator. It first tries a, and returns its
-result if successful. If a fails, then b is returned.
val fix : ?sub1:('at‑>'at) list ‑> ?sub2:('at‑>'at‑>'at) list ‑> ?subn:(int t * ('a list t‑>'at)) list ‑> base:'at‑> int t‑>'at
Recursion combinators, for building recursive values.
-The integer generator is used to provide fuel. The sub_ generators
-should use their arguments only once!
Parametersub1: cases that recurse on one value.
Parametersub2: cases that use the recursive gen twice.
Parametersubn: cases that use a list of recursive cases.
replicate n g makes a list of n elements which are all generated randomly using g.
val sample_without_replacement : compare:('a->'a-> int) -> int ->'at->'a list t
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.
deprecated
use sample_without_duplicates instead
raises Invalid_argument
if n <= 0.
since
0.15
val sample_without_duplicates : cmp:('a->'a-> int) -> int ->'at->'a list t
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.
retry g calls g until it returns some value, or until the maximum number of retries was reached. If g fails, then it counts for one iteration, and the generator retries.
parameter max:
maximum number of retries. Default 10.
val try_successively : 'a option t list ->'a option t
try_successively l tries each generator of l, one after the other. If some generator succeeds its result is returned, else the next generator is tried.
a <?> b is a choice operator. It first tries a, and returns its result if successful. If a fails, then b is returned.
val fix : ?sub1:('at->'at) list -> ?sub2:('at->'at->'at) list -> ?subn:(int t * ('a list t->'at)) list -> base:'at-> int t->'at
Recursion combinators, for building recursive values. The integer generator is used to provide fuel. The sub_ generators should use their arguments only once!
Using a random state (possibly the one in argument) run a generator.
\ No newline at end of file
diff --git a/dev/containers/CCRef/index.html b/dev/containers/CCRef/index.html
index f1787792..46894c23 100644
--- a/dev/containers/CCRef/index.html
+++ b/dev/containers/CCRef/index.html
@@ -1,2 +1,2 @@
-CCRef (containers.CCRef)
\ No newline at end of file
diff --git a/dev/containers/CCResult/Infix/index.html b/dev/containers/CCResult/Infix/index.html
index a6636cf7..3e0da1e9 100644
--- a/dev/containers/CCResult/Infix/index.html
+++ b/dev/containers/CCResult/Infix/index.html
@@ -1,5 +1,2 @@
-Infix (containers.CCResult.Infix)
ModuleCCResult.Infix
val (>|=) : ('a, 'err) t‑> ('a‑>'b) ‑> ('b, 'err) t
val (>>=) : ('a, 'err) t‑> ('a‑> ('b, 'err) t) ‑> ('b, 'err) t
Monadic composition. e >>= f proceeds as f x if e is Ok x
-or returns e if e is an Error.
val (<*>) : ('a‑>'b, 'err) t‑> ('a, 'err) t‑> ('b, 'err) t
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
+Infix (containers.CCResult.Infix)
Module CCResult.Infix
val (>|=) : ('a, 'err) t-> ('a->'b) -> ('b, 'err) t
val (>>=) : ('a, 'err) t-> ('a-> ('b, 'err) t) -> ('b, 'err) t
Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.
val (<*>) : ('a->'b, 'err) t-> ('a, 'err) t-> ('b, 'err) t
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/dev/containers/CCResult/Traverse/argument-1-M/index.html b/dev/containers/CCResult/Traverse/argument-1-M/index.html
index 63ae4079..cd198849 100644
--- a/dev/containers/CCResult/Traverse/argument-1-M/index.html
+++ b/dev/containers/CCResult/Traverse/argument-1-M/index.html
@@ -1,2 +1,2 @@
-1-M (containers.CCResult.Traverse.1-M)
\ No newline at end of file
diff --git a/dev/containers/CCResult/Traverse/index.html b/dev/containers/CCResult/Traverse/index.html
index 70819ccb..f455d5ab 100644
--- a/dev/containers/CCResult/Traverse/index.html
+++ b/dev/containers/CCResult/Traverse/index.html
@@ -1,2 +1,2 @@
-Traverse (containers.CCResult.Traverse)
val retry_m : int -> (unit -> ('a, 'err) tM.t) -> ('a, 'err list) tM.t
\ No newline at end of file
diff --git a/dev/containers/CCResult/index.html b/dev/containers/CCResult/index.html
index a1eecf7d..e9e24ddc 100644
--- a/dev/containers/CCResult/index.html
+++ b/dev/containers/CCResult/index.html
@@ -1,27 +1,2 @@
-CCResult (containers.CCResult)
ModuleCCResult
Error Monad
Uses the new "result" type from OCaml 4.03.
Since: 0.16
type 'a sequence = ('a‑> unit) ‑> unit
type 'a equal = 'a‑>'a‑> bool
type 'a ord = 'a‑>'a‑> int
type 'a printer = Format.formatter ‑>'a‑> unit
Basics
Since: 1.5
include module type of sig ... end
type ('a, 'b) result = ('a, 'b) Pervasives.result =
| Ok of 'a
| Error of 'b
type (+'good, +'bad) t = ('good, 'bad) Result.result =
val (<*>) : ('a‑>'b, 'err) t‑> ('a, 'err) t‑> ('b, 'err) t
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.
val both : ('a, 'err) t‑> ('b, 'err) t‑> ('a * 'b, 'err) t
both a b, in case of success, returns Ok (o, o') with the ok values
-of a and b. Otherwise, it fails, and the error of a is chosen over the
-error of b if both fail.
val map_l : ('a‑> ('b, 'err) t) ‑>'a list ‑> ('b list, 'err) t
val fold_l : ('b‑>'a‑> ('b, 'err) t) ‑>'b‑>'a list ‑> ('b, 'err) t
val fold_seq : ('b‑>'a‑> ('b, 'err) t) ‑>'b‑>'asequence‑> ('b, 'err) t
Misc
val choose : ('a, 'err) t list ‑> ('a, 'err list) t
choose l selects a member of l that is a Ok _ value,
-or returns Error l otherwise, where l is the list of errors.
val retry : int ‑> (unit ‑> ('a, 'err) t) ‑> ('a, 'err list) t
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.
val (<*>) : ('a->'b, 'err) t-> ('a, 'err) t-> ('b, 'err) t
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.
val both : ('a, 'err) t-> ('b, 'err) t-> ('a * 'b, 'err) t
both a b, in case of success, returns Ok (o, o') with the ok values of a and b. Otherwise, it fails, and the error of a is chosen over the error of b if both fail.
val map_l : ('a-> ('b, 'err) t) ->'a list -> ('b list, 'err) t
map_l f [a1; ...; an] applies the function f to a1, ..., an , and, in case of success for every element, returns the list of Ok-value. Otherwise, it fails and returns the first error encountered. Tail-recursive.
val fold_l : ('b->'a-> ('b, 'err) t) ->'b->'a list -> ('b, 'err) t
val fold_seq : ('b->'a-> ('b, 'err) t) ->'b->'asequence-> ('b, 'err) t
Misc
val choose : ('a, 'err) t list -> ('a, 'err list) t
choose l selects a member of l that is a Ok _ value, or returns Error l otherwise, where l is the list of errors.
val retry : int -> (unit -> ('a, 'err) t) -> ('a, 'err list) t
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.
\ No newline at end of file
diff --git a/dev/containers/CCResult/module-type-MONAD/index.html b/dev/containers/CCResult/module-type-MONAD/index.html
index 95d076f3..62dd06d6 100644
--- a/dev/containers/CCResult/module-type-MONAD/index.html
+++ b/dev/containers/CCResult/module-type-MONAD/index.html
@@ -1,2 +1,2 @@
-MONAD (containers.CCResult.MONAD)
\ No newline at end of file
diff --git a/dev/containers/CCSet/index.html b/dev/containers/CCSet/index.html
index 55922017..e649373b 100644
--- a/dev/containers/CCSet/index.html
+++ b/dev/containers/CCSet/index.html
@@ -1,2 +1,2 @@
-CCSet (containers.CCSet)
module Make : functor (O : Set.OrderedType) ->SwithtypeMake.t = Set.Make(O).t andtypeMake.elt = O.t
\ No newline at end of file
diff --git a/dev/containers/CCSet/module-type-S/index.html b/dev/containers/CCSet/module-type-S/index.html
index 05f676c5..3b6449f1 100644
--- a/dev/containers/CCSet/module-type-S/index.html
+++ b/dev/containers/CCSet/module-type-S/index.html
@@ -1,3 +1,2 @@
-S (containers.CCSet.S)
to_list t converts the set t to a list of the elements.
val pp : ?start:string -> ?stop:string -> ?sep:string ->eltprinter->tprinter
Print the set.
\ No newline at end of file
diff --git a/dev/containers/CCString/Find/index.html b/dev/containers/CCString/Find/index.html
index b2e36b81..17af4ee8 100644
--- a/dev/containers/CCString/Find/index.html
+++ b/dev/containers/CCString/Find/index.html
@@ -1,2 +1,2 @@
-Find (containers.CCString.Find)
val find : ?start:int -> pattern:[ `Direct ] pattern-> string -> int
Search for pattern in the string, left-to-right.
returns
the offset of the first match, -1 otherwise.
parameter start
offset in string at which we start.
val rfind : ?start:int -> pattern:[ `Reverse ] pattern-> string -> int
Search for pattern in the string, right-to-left.
returns
the offset of the start of the first match from the right, -1 otherwise.
parameter start
right-offset in string at which we start.
\ No newline at end of file
diff --git a/dev/containers/CCString/Split/index.html b/dev/containers/CCString/Split/index.html
index 91e9235e..6204aa63 100644
--- a/dev/containers/CCString/Split/index.html
+++ b/dev/containers/CCString/Split/index.html
@@ -1,9 +1,2 @@
-Split (containers.CCString.Split)
ModuleCCString.Split
type drop_if_empty = {
first : bool;
last : bool;
}
Specification of what to do with empty blocks, as in split ~by:"-" "-a-b-".
{first=false; last=false} will return ""; "a"; "b"; ""
{first=true; last=false} will return "a"; "b" ""
{first=false; last=true} will return ""; "a"; "b"
{first=true; last=true} will return "a"; "b"
The default value of all remaining functions is Drop_none.
val klist_cpy : ?drop:drop_if_empty-> by:string -> string -> string klist
val left : by:string -> string -> (string * string) option
Split on the first occurrence of by from the leftmost part of the string.
since
0.12
val left_exn : by:string -> string -> string * string
Split on the first occurrence of by from the leftmost part of the string.
raises Not_found
if by is not part of the string.
since
0.16
val right : by:string -> string -> (string * string) option
Split on the first occurrence of by from the rightmost part of the string.
since
0.12
val right_exn : by:string -> string -> string * string
Split on the first occurrence of by from the rightmost part of the string.
raises Not_found
if by is not part of the string.
since
0.16
\ No newline at end of file
diff --git a/dev/containers/CCString/Sub/index.html b/dev/containers/CCString/Sub/index.html
index 7dfdd05c..327b3aa7 100644
--- a/dev/containers/CCString/Sub/index.html
+++ b/dev/containers/CCString/Sub/index.html
@@ -1,3 +1,2 @@
-Sub (containers.CCString.Sub)
\ No newline at end of file
diff --git a/dev/containers/CCString/index.html b/dev/containers/CCString/index.html
index c5e1f7a5..968b9362 100644
--- a/dev/containers/CCString/index.html
+++ b/dev/containers/CCString/index.html
@@ -1,21 +1,2 @@
-CCString (containers.CCString)
ModuleCCString
Basic String Utils
Consider using Containers_string.KMP for pattern search, or Regex
-libraries.
type 'a gen = unit ‑>'a option
type 'a sequence = ('a‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'aklist ]
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).
compare_versions a b compares version stringsa and b,
-considering that numbers are above text.
Since: 0.13
val compare_natural : string ‑> string ‑> int
Natural Sort Order, comparing chunks of digits as natural numbers.
-https://en.wikipedia.org/wiki/Natural_sort_order
Since: 1.3
val edit_distance : string ‑> string ‑> int
Edition distance between two strings. This satisfies the classical
-distance axioms: it is always positive, symmetric, and satisfies
-the formula distance a b + distance b c >= distance a c.
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).
compare_versions a b compares version strings a and b, considering that numbers are above text.
since
0.13
val compare_natural : string -> string -> int
Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order
since
1.3
val edit_distance : string -> string -> int
Edition distance between two strings. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance a b + distance b c >= distance a c.
\ No newline at end of file
diff --git a/dev/containers/CCString/module-type-S/index.html b/dev/containers/CCString/module-type-S/index.html
index e91d8c6d..fea9855c 100644
--- a/dev/containers/CCString/module-type-S/index.html
+++ b/dev/containers/CCString/module-type-S/index.html
@@ -1,3 +1,2 @@
-S (containers.CCString.S)
\ No newline at end of file
diff --git a/dev/containers/CCUtf8_string/index.html b/dev/containers/CCUtf8_string/index.html
index b421e73e..8c441678 100644
--- a/dev/containers/CCUtf8_string/index.html
+++ b/dev/containers/CCUtf8_string/index.html
@@ -1,3 +1,2 @@
-CCUtf8_string (containers.CCUtf8_string)
Conversion from a string without validating. Upon iteration, if an invalid substring is met, Malformed will be raised.
\ No newline at end of file
diff --git a/dev/containers/CCVector/index.html b/dev/containers/CCVector/index.html
index 3fad8da5..40494b1d 100644
--- a/dev/containers/CCVector/index.html
+++ b/dev/containers/CCVector/index.html
@@ -1,23 +1,2 @@
-CCVector (containers.CCVector)
ModuleCCVector
Growable, mutable vector
type ro = [
| `RO
]
type rw = [
| `RW
]
Mutability is rw (read-write) or ro (read-only).
type ('a, 'mut) t
The type of a vector of elements of type 'a, with
-a mutability flat 'mut.
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.
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!).
Range 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].
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!).
Range 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].
fill_empty_slots_with v x puts x in the slots of v's underlying array that are not used (ie in the last capacity v - length v slots). This is useful if you removed some elements from the vector and want to be sure they can be GC'd by erasing them from the vector.
since
2.4
val of_klist : ?init:('a, rw) t->'aklist-> ('a, rw) t
\ 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 6a64d417..e1883401 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)
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html b/dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html
index 6ee3e6f7..e90f4416 100644
--- a/dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html
+++ b/dev/containers/Containers/Hashtbl/MakeSeeded/argument-1-H/index.html
@@ -1,2 +1,2 @@
-1-H (containers.Containers.Hashtbl.MakeSeeded.1-H)
\ 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 2c54f0b7..657a3864 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)
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/index.html b/dev/containers/Containers/Hashtbl/index.html
index a813928c..2abcdeb3 100644
--- a/dev/containers/Containers/Hashtbl/index.html
+++ b/dev/containers/Containers/Hashtbl/index.html
@@ -1,21 +1,2 @@
-Hashtbl (containers.Containers.Hashtbl)
ModuleContainers.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
keys_list t is the list of keys in t.
-If the key is in the Hashtable multiple times, all occurrences will be returned.
Since: 0.8
val values_list : ('a, 'b) Hashtbl.t ‑>'b list
values_list t is the list of values in t.
Since: 0.8
val map_list : ('a‑>'b‑>'c) ‑> ('a, 'b) Hashtbl.t ‑>'c list
Map on a hashtable's items, collect into a list.
val incr : ?by:int ‑> ('a, int) Hashtbl.t ‑>'a‑> unit
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).
Parameterby: if specified, the int value is incremented by by rather than 1.
Since: 0.16
val decr : ?by:int ‑> ('a, int) Hashtbl.t ‑>'a‑> unit
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.
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.
Like add_seq_count, but allocates a new table and returns it.
Since: 0.16
val to_list : ('a, 'b) Hashtbl.t ‑> ('a * 'b) list
List of bindings (order unspecified).
val of_list : ('a * 'b) list ‑> ('a, 'b) Hashtbl.t
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.
val update : ('a, 'b) Hashtbl.t ‑> f:('a‑>'b option ‑>'b option) ‑> k:'a‑> unit
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
val get_or_add : ('a, 'b) Hashtbl.t ‑> f:('a‑>'b) ‑> k:'a‑>'b
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.
keys_list t is the list of keys in t. If the key is in the Hashtable multiple times, all occurrences will be returned.
since
0.8
val values_list : ('a, 'b) Hashtbl.t ->'b list
values_list t is the list of values in t.
since
0.8
val map_list : ('a->'b->'c) -> ('a, 'b) Hashtbl.t ->'c list
Map on a hashtable's items, collect into a list.
val incr : ?by:int -> ('a, int) Hashtbl.t ->'a-> unit
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
val decr : ?by:int -> ('a, int) Hashtbl.t ->'a-> unit
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.
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.
Like add_seq_count, but allocates a new table and returns it.
since
0.16
val to_list : ('a, 'b) Hashtbl.t -> ('a * 'b) list
List of bindings (order unspecified).
val of_list : ('a * 'b) list -> ('a, 'b) Hashtbl.t
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.
val update : ('a, 'b) Hashtbl.t -> f:('a->'b option ->'b option) -> k:'a-> unit
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
val get_or_add : ('a, 'b) Hashtbl.t -> f:('a->'b) -> k:'a->'b
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.
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html b/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html
index 5ebe8dd7..550d5afc 100644
--- a/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html
+++ b/dev/containers/Containers/Hashtbl/module-type-HashedType/index.html
@@ -1,2 +1,2 @@
-HashedType (containers.Containers.Hashtbl.HashedType)
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/module-type-S'/index.html b/dev/containers/Containers/Hashtbl/module-type-S'/index.html
index 8262087a..5e656e4c 100644
--- a/dev/containers/Containers/Hashtbl/module-type-S'/index.html
+++ b/dev/containers/Containers/Hashtbl/module-type-S'/index.html
@@ -1,21 +1,2 @@
-S' (containers.Containers.Hashtbl.S')
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).
Parameterby: if specified, the int value is incremented by by rather than 1.
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.
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.
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.
val update : 'at‑> f:(key‑>'a option ‑>'a option) ‑> k:key‑> unit
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.
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.
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.
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.
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.
val update : 'at-> f:(key->'a option ->'a option) -> k:key-> unit
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.
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/module-type-S/index.html b/dev/containers/Containers/Hashtbl/module-type-S/index.html
index 1fc7cd07..49738ab9 100644
--- a/dev/containers/Containers/Hashtbl/module-type-S/index.html
+++ b/dev/containers/Containers/Hashtbl/module-type-S/index.html
@@ -1,2 +1,2 @@
-S (containers.Containers.Hashtbl.S)
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html b/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html
index e7c21d46..65a3daba 100644
--- a/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html
+++ b/dev/containers/Containers/Hashtbl/module-type-SeededHashedType/index.html
@@ -1,2 +1,2 @@
-SeededHashedType (containers.Containers.Hashtbl.SeededHashedType)
\ No newline at end of file
diff --git a/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html b/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html
index 906f36c0..b0ededae 100644
--- a/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html
+++ b/dev/containers/Containers/Hashtbl/module-type-SeededS/index.html
@@ -1,2 +1,2 @@
-SeededS (containers.Containers.Hashtbl.SeededS)
\ No newline at end of file
diff --git a/dev/containers/Containers/index.html b/dev/containers/Containers/index.html
index 00f9e02d..2569d292 100644
--- a/dev/containers/Containers/index.html
+++ b/dev/containers/Containers/index.html
@@ -1,2 +1,2 @@
-Containers (containers.Containers)
Shadow unsafe functions and operators from Pervasives
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int
Infix operators for Floats
val (=.) : float -> float -> bool
since
2.1
val (<>.) : float -> float -> bool
since
2.1
val (<.) : float -> float -> bool
since
2.1
val (>.) : float -> float -> bool
since
2.1
val (<=.) : float -> float -> bool
since
2.1
val (>=.) : float -> float -> bool
since
2.1
Shadow Dangerous Operators
val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
since
2.1
\ No newline at end of file
diff --git a/dev/containers/index.html b/dev/containers/index.html
index fb11fe9a..dd4fe1b3 100644
--- a/dev/containers/index.html
+++ b/dev/containers/index.html
@@ -1,3 +1,2 @@
-index (containers.index)
Library containers
-This library exposes the following toplevel modules:
The entry point of this library is the module: Containers_top.
Library containers.unix
The entry point of this library is the module: CCUnix.
\ No newline at end of file
diff --git a/dev/index.html b/dev/index.html
index 86e83d8a..05854661 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -7,17 +7,13 @@
-