@@ -5,10 +5,10 @@ open Kcas
55 The interface provides a subset of the OCaml [Stdlib.Hashtbl] module with
66 some changes:
77
8- - The functorial interface of the [Stdlib.Hashtbl] is not provided.
9- Instead the constructor functions, {!create}, {!of_seq}, and {!rebuild},
10- take an optional [HashedType] module as an argument. By default {!create}
11- returns a randomized hash table.
8+ - The functorial interface of the [Stdlib.Hashtbl] is not provided. Instead
9+ the constructor functions, {!create}, {!of_seq}, and {!rebuild}, take an
10+ optional [HashedType] module as an argument. By default {!create} returns
11+ a randomized hash table.
1212 - The [add_seq] and [replace_seq] operations are not provided at all.
1313 - Non-instance specific operations related to randomization (e.g.
1414 [randomize], [is_randomized]) are not provided.
@@ -20,13 +20,13 @@ open Kcas
2020 {!fold}, and {!stats} are not provided.
2121
2222 Please note that the design is intentionally based on [Stdlib.Hashtbl] and
23- copies its semantics as accurately as possible. Some of the operations come
23+ copies its semantics as accurately as possible. Some of the operations come
2424 with warnings.
2525
26- The hash table implementation is designed to avoid starvation. Read-only
27- accesses can generally proceed in parallel without interference. Write
26+ The hash table implementation is designed to avoid starvation. Read-only
27+ accesses can generally proceed in parallel without interference. Write
2828 accesses that do not change the number of bindings can proceed in parallel
29- as long as they hit different internal buckets. Write accesses that change
29+ as long as they hit different internal buckets. Write accesses that change
3030 the number of bindings use a scalable {!Accumulator} and only make
3131 infrequent random checks to determine whether the hash table should be
3232 resized. *)
@@ -80,10 +80,10 @@ val of_seq :
8080 ('k * 'v ) Seq .t ->
8181 ('k , 'v ) t
8282(* * [of_seq assoc] creates a new hash table from the given association sequence
83- [assoc]. The associations are added in the same order as they appear in the
83+ [assoc]. The associations are added in the same order as they appear in the
8484 sequence, using {!replace}, which means that if two pairs have the same key,
85- only the latest one will appear in the table. See {!create} for the
86- optional arguments.
85+ only the latest one will appear in the table. See {!create} for the optional
86+ arguments.
8787
8888 ⚠️ [of_seq (to_seq t)] does not necessarily copy the bindings of a hash table
8989 correctly. *)
@@ -109,7 +109,7 @@ val find : ('k, 'v) t -> 'k -> 'v
109109
110110val to_seq : ('k , 'v ) t -> ('k * 'v ) Seq .t
111111(* * [to_seq t] takes a snapshot of the keys and values in the hash table and
112- returns them as an association sequence. Bindings of each individual key
112+ returns them as an association sequence. Bindings of each individual key
113113 appear in the sequence in reverse order of their introduction.
114114
115115 ⚠️ [of_seq (to_seq t)] does not necessarily copy the bindings of a hash table
@@ -134,12 +134,12 @@ val rebuild :
134134(* * [rebuild t] returns a copy of the given hash table [t] optionally rehashing
135135 all of the bindings.
136136
137- See {!create} for descriptions of the optional arguments. Unlike {!create},
137+ See {!create} for descriptions of the optional arguments. Unlike {!create},
138138 [rebuild] uses the given hash table [t] as a template to get defaults for
139139 the optional arguments. *)
140140
141141val copy : ('k , 'v ) t -> ('k , 'v ) t
142- (* * [copy t] is equivalent to [rebuild t]. In other words, the returned hash
142+ (* * [copy t] is equivalent to [rebuild t]. In other words, the returned hash
143143 table uses the same {!hashed_type} (and other parameters) as the given hash
144144 table [t]. *)
145145
@@ -148,15 +148,16 @@ val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
148148
149149val filter_map_inplace : ('k -> 'v -> 'v option ) -> ('k , 'v ) t -> unit
150150(* * [filter_map_inplace f t] applies [f] to all bindings in the hash table [t]
151- and updates each binding depending on the result of [f]. If [f] returns
152- [None], the binding is discarded. If [f] returns [Some new_value], the
151+ and updates each binding depending on the result of [f]. If [f] returns
152+ [None], the binding is discarded. If [f] returns [Some new_value], the
153153 binding is updated to associate the key to the [new_value].
154154
155155 ⚠️ The given [f] may be called multiple times for the same bindings from
156156 multiple domains in parallel. *)
157157
158158val fold : ('a -> 'b -> 'c -> 'c ) -> ('a , 'b ) t -> 'c -> 'c
159- (* * [fold f t a] is equivalent to [Seq.fold_left (fun a (k, v) -> f k v a) a (to_seq t)]. *)
159+ (* * [fold f t a] is equivalent to
160+ [Seq.fold_left (fun a (k, v) -> f k v a) a (to_seq t)]. *)
160161
161162val stats : ('a , 'b ) t -> Stdlib.Hashtbl .statistics
162163(* * [stats t] returns statistics about the hash table [t]. *)
0 commit comments