2
type ('a, 'b) t = ('a, 'b) Hashtbl.t
3
(** Alias for {!Hashtbl.t} *)
6
type statistics = Hashtbl.statistics =
10
max_bucket_length: int ;
11
bucket_histogram: int array }
14
type statistics = Stdcompat__hashtbl_ext.statistics =
18
max_bucket_length: int ;
19
bucket_histogram: int array }
26
max_bucket_length: int ;
27
bucket_histogram: int array }
30
module type HashedType =
31
sig type t val equal : t -> t -> bool val hash : t -> int end
32
(** Alias for {!Hashtbl.HashedType} *)
39
val create : int -> 'a t
40
val clear : 'a t -> unit
41
val reset : 'a t -> unit
42
val copy : 'a t -> 'a t
43
val add : 'a t -> key -> 'a -> unit
44
val remove : 'a t -> key -> unit
45
val find : 'a t -> key -> 'a
46
val find_opt : 'a t -> key -> 'a option
47
val find_all : 'a t -> key -> 'a list
48
val replace : 'a t -> key -> 'a -> unit
49
val mem : 'a t -> key -> bool
50
val iter : (key -> 'a -> unit) -> 'a t -> unit
51
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
52
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
53
val length : 'a t -> int
54
val stats : 'a t -> statistics
55
val to_seq : 'a t -> (key * 'a) Seq.t
56
val to_seq_keys : 'a t -> key Seq.t
57
val to_seq_values : 'a t -> 'a Seq.t
58
val add_seq : 'a t -> (key * 'a) Seq.t -> unit
59
val replace_seq : 'a t -> (key * 'a) Seq.t -> unit
60
val of_seq : (key * 'a) Seq.t -> 'a t
68
val create : int -> 'a t
69
val clear : 'a t -> unit
70
val reset : 'a t -> unit
71
val copy : 'a t -> 'a t
72
val add : 'a t -> key -> 'a -> unit
73
val remove : 'a t -> key -> unit
74
val find : 'a t -> key -> 'a
75
val find_opt : 'a t -> key -> 'a option
76
val find_all : 'a t -> key -> 'a list
77
val replace : 'a t -> key -> 'a -> unit
78
val mem : 'a t -> key -> bool
79
val iter : (key -> 'a -> unit) -> 'a t -> unit
80
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
81
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
82
val length : 'a t -> int
83
val stats : 'a t -> statistics
84
val to_seq : 'a t -> (key * 'a) Stdcompat__seq.t
85
val to_seq_keys : 'a t -> key Stdcompat__seq.t
86
val to_seq_values : 'a t -> 'a Stdcompat__seq.t
87
val add_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
88
val replace_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
89
val of_seq : (key * 'a) Stdcompat__seq.t -> 'a t
97
val create : int -> 'a t
98
val clear : 'a t -> unit
99
val reset : 'a t -> unit
100
val copy : 'a t -> 'a t
101
val add : 'a t -> key -> 'a -> unit
102
val remove : 'a t -> key -> unit
103
val find : 'a t -> key -> 'a
104
val find_opt : 'a t -> key -> 'a option
105
val find_all : 'a t -> key -> 'a list
106
val replace : 'a t -> key -> 'a -> unit
107
val mem : 'a t -> key -> bool
108
val iter : (key -> 'a -> unit) -> 'a t -> unit
109
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
110
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
111
val length : 'a t -> int
112
val stats : 'a t -> statistics
113
val to_seq : 'a t -> (key * 'a) Seq.t
114
val to_seq_keys : 'a t -> key Seq.t
115
val to_seq_values : 'a t -> 'a Seq.t
116
val add_seq : 'a t -> (key * 'a) Seq.t -> unit
117
val replace_seq : 'a t -> (key * 'a) Seq.t -> unit
118
val of_seq : (key * 'a) Seq.t -> 'a t
123
module Make = Hashtbl.Make
125
@BEGIN_BEFORE_4_07_0@
127
functor (H : HashedType) ->
130
type 'a t = 'a Hashtbl.Make(H).t
131
val create : int -> 'a t
132
val clear : 'a t -> unit
133
val reset : 'a t -> unit
134
val copy : 'a t -> 'a t
135
val add : 'a t -> key -> 'a -> unit
136
val remove : 'a t -> key -> unit
137
val find : 'a t -> key -> 'a
138
val find_opt : 'a t -> key -> 'a option
139
val find_all : 'a t -> key -> 'a list
140
val replace : 'a t -> key -> 'a -> unit
141
val mem : 'a t -> key -> bool
142
val iter : (key -> 'a -> unit) -> 'a t -> unit
143
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
144
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
145
val length : 'a t -> int
146
val stats : 'a t -> statistics
147
val to_seq : 'a t -> (key * 'a) Stdcompat__seq.t
148
val to_seq_keys : 'a t -> key Stdcompat__seq.t
149
val to_seq_values : 'a t -> 'a Stdcompat__seq.t
150
val add_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
151
val replace_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
152
val of_seq : (key * 'a) Stdcompat__seq.t -> 'a t
155
(** @since 4.07.0: module Make = Hashtbl.Make
159
module type SeededHashedType =
160
sig type t val equal : t -> t -> bool val hash : int -> t -> int end
162
@BEGIN_BEFORE_4_00_0@
163
module type SeededHashedType =
164
sig type t val equal : t -> t -> bool val hash : int -> t -> int end
167
module type SeededHashedType =
168
sig type t val equal : t -> t -> bool val hash : int -> t -> int end
172
module type SeededS =
176
val create : ?random:bool -> int -> 'a t
177
val clear : 'a t -> unit
178
val reset : 'a t -> unit
179
val copy : 'a t -> 'a t
180
val add : 'a t -> key -> 'a -> unit
181
val remove : 'a t -> key -> unit
182
val find : 'a t -> key -> 'a
183
val find_opt : 'a t -> key -> 'a option
184
val find_all : 'a t -> key -> 'a list
185
val replace : 'a t -> key -> 'a -> unit
186
val mem : 'a t -> key -> bool
187
val iter : (key -> 'a -> unit) -> 'a t -> unit
188
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
189
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
190
val length : 'a t -> int
191
val stats : 'a t -> statistics
192
val to_seq : 'a t -> (key * 'a) Seq.t
193
val to_seq_keys : 'a t -> key Seq.t
194
val to_seq_values : 'a t -> 'a Seq.t
195
val add_seq : 'a t -> (key * 'a) Seq.t -> unit
196
val replace_seq : 'a t -> (key * 'a) Seq.t -> unit
197
val of_seq : (key * 'a) Seq.t -> 'a t
200
@BEGIN_BEFORE_4_07_0@
201
module type SeededS =
205
val create : ?random:bool -> int -> 'a t
206
val clear : 'a t -> unit
207
val reset : 'a t -> unit
208
val copy : 'a t -> 'a t
209
val add : 'a t -> key -> 'a -> unit
210
val remove : 'a t -> key -> unit
211
val find : 'a t -> key -> 'a
212
val find_opt : 'a t -> key -> 'a option
213
val find_all : 'a t -> key -> 'a list
214
val replace : 'a t -> key -> 'a -> unit
215
val mem : 'a t -> key -> bool
216
val iter : (key -> 'a -> unit) -> 'a t -> unit
217
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
218
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
219
val length : 'a t -> int
220
val stats : 'a t -> statistics
221
val to_seq : 'a t -> (key * 'a) Stdcompat__seq.t
222
val to_seq_keys : 'a t -> key Stdcompat__seq.t
223
val to_seq_values : 'a t -> 'a Stdcompat__seq.t
224
val add_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
225
val replace_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
226
val of_seq : (key * 'a) Stdcompat__seq.t -> 'a t
230
module type SeededS =
234
val create : ?random:bool -> int -> 'a t
235
val clear : 'a t -> unit
236
val reset : 'a t -> unit
237
val copy : 'a t -> 'a t
238
val add : 'a t -> key -> 'a -> unit
239
val remove : 'a t -> key -> unit
240
val find : 'a t -> key -> 'a
241
val find_opt : 'a t -> key -> 'a option
242
val find_all : 'a t -> key -> 'a list
243
val replace : 'a t -> key -> 'a -> unit
244
val mem : 'a t -> key -> bool
245
val iter : (key -> 'a -> unit) -> 'a t -> unit
246
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
247
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
248
val length : 'a t -> int
249
val stats : 'a t -> statistics
250
val to_seq : 'a t -> (key * 'a) Seq.t
251
val to_seq_keys : 'a t -> key Seq.t
252
val to_seq_values : 'a t -> 'a Seq.t
253
val add_seq : 'a t -> (key * 'a) Seq.t -> unit
254
val replace_seq : 'a t -> (key * 'a) Seq.t -> unit
255
val of_seq : (key * 'a) Seq.t -> 'a t
260
module MakeSeeded = Hashtbl.MakeSeeded
262
@BEGIN_BEFORE_4_07_0@
264
functor (H : SeededHashedType) ->
267
type 'a t = 'a Stdcompat__hashtbl_ext.MakeSeeded(H).t
268
val create : ?random:bool -> int -> 'a t
269
val clear : 'a t -> unit
270
val reset : 'a t -> unit
271
val copy : 'a t -> 'a t
272
val add : 'a t -> key -> 'a -> unit
273
val remove : 'a t -> key -> unit
274
val find : 'a t -> key -> 'a
275
val find_opt : 'a t -> key -> 'a option
276
val find_all : 'a t -> key -> 'a list
277
val replace : 'a t -> key -> 'a -> unit
278
val mem : 'a t -> key -> bool
279
val iter : (key -> 'a -> unit) -> 'a t -> unit
280
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
281
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
282
val length : 'a t -> int
283
val stats : 'a t -> statistics
284
val to_seq : 'a t -> (key * 'a) Stdcompat__seq.t
285
val to_seq_keys : 'a t -> key Stdcompat__seq.t
286
val to_seq_values : 'a t -> 'a Stdcompat__seq.t
287
val add_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
288
val replace_seq : 'a t -> (key * 'a) Stdcompat__seq.t -> unit
289
val of_seq : (key * 'a) Stdcompat__seq.t -> 'a t
292
(** @since 4.07.0: module MakeSeeded = Hashtbl.MakeSeeded
296
val to_seq : ('a, 'b) t -> ('a * 'b) Seq.t
298
@BEGIN_BEFORE_4_07_0@
299
val to_seq : ('a, 'b) t -> ('a * 'b) Stdcompat__seq.t
301
(** @since 4.07.0: val to_seq : ('a, 'b) t -> ('a * 'b) Seq.t
305
val to_seq_keys : ('a, 'b) t -> 'a Seq.t
307
@BEGIN_BEFORE_4_07_0@
308
val to_seq_keys : ('a, 'b) t -> 'a Stdcompat__seq.t
310
(** @since 4.07.0: val to_seq_keys : ('a, 'b) t -> 'a Seq.t
314
val to_seq_values : ('a, 'b) t -> 'b Seq.t
316
@BEGIN_BEFORE_4_07_0@
317
val to_seq_values : ('a, 'b) t -> 'b Stdcompat__seq.t
319
(** @since 4.07.0: val to_seq_values : ('a, 'b) t -> 'b Seq.t
323
val add_seq : ('a, 'b) t -> ('a * 'b) Seq.t -> unit
325
@BEGIN_BEFORE_4_07_0@
326
val add_seq : ('a, 'b) t -> ('a * 'b) Stdcompat__seq.t -> unit
328
(** @since 4.07.0: val add_seq : ('a, 'b) t -> ('a * 'b) Seq.t -> unit
332
val replace_seq : ('a, 'b) t -> ('a * 'b) Seq.t -> unit
334
@BEGIN_BEFORE_4_07_0@
335
val replace_seq : ('a, 'b) t -> ('a * 'b) Stdcompat__seq.t -> unit
337
(** @since 4.07.0: val replace_seq : ('a, 'b) t -> ('a * 'b) Seq.t -> unit
341
val of_seq : ('a * 'b) Seq.t -> ('a, 'b) t
343
@BEGIN_BEFORE_4_07_0@
344
val of_seq : ('a * 'b) Stdcompat__seq.t -> ('a, 'b) t
346
(** @since 4.07.0: val of_seq : ('a * 'b) Seq.t -> ('a, 'b) t
349
val find_opt : ('a, 'b) t -> 'a -> 'b option
350
(** @since 4.05.0: val find_opt : ('a, 'b) t -> 'a -> 'b option *)
352
val filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unit
354
val filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unit *)
356
val is_randomized : unit -> bool
357
(** @since 4.03.0: val is_randomized : unit -> bool *)
359
val create : ?random:bool -> int -> ('a, 'b) t
360
(** @since 4.00.0: val create : ?random:bool -> int -> ('a, 'b) t *)
362
val reset : ('a, 'b) t -> unit
363
(** @since 4.00.0: val reset : ('a, 'b) t -> unit *)
365
val randomize : unit -> unit
366
(** @since 4.00.0: val randomize : unit -> unit *)
368
val stats : ('a, 'b) t -> statistics
369
(** @since 4.00.0: val stats : ('a, 'b) t -> statistics *)
371
val seeded_hash : int -> 'a -> int
372
(** @since 4.00.0: val seeded_hash : int -> 'a -> int *)
374
val seeded_hash_param : int -> int -> int -> 'a -> int
375
(** @since 4.00.0: val seeded_hash_param : int -> int -> int -> 'a -> int *)
377
val length : ('a, 'b) t -> int
378
(** @since 3.08.0: val length : ('a, 'b) t -> int *)
380
val clear : ('a, 'b) t -> unit
381
(** Alias for {!Hashtbl.clear} *)
383
val copy : ('a, 'b) t -> ('a, 'b) t
384
(** Alias for {!Hashtbl.copy} *)
386
val add : ('a, 'b) t -> 'a -> 'b -> unit
387
(** Alias for {!Hashtbl.add} *)
389
val find : ('a, 'b) t -> 'a -> 'b
390
(** Alias for {!Hashtbl.find} *)
392
val find_all : ('a, 'b) t -> 'a -> 'b list
393
(** Alias for {!Hashtbl.find_all} *)
395
val mem : ('a, 'b) t -> 'a -> bool
396
(** Alias for {!Hashtbl.mem} *)
398
val remove : ('a, 'b) t -> 'a -> unit
399
(** Alias for {!Hashtbl.remove} *)
401
val replace : ('a, 'b) t -> 'a -> 'b -> unit
402
(** Alias for {!Hashtbl.replace} *)
404
val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
405
(** Alias for {!Hashtbl.iter} *)
407
val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
408
(** Alias for {!Hashtbl.fold} *)
411
(** Alias for {!Hashtbl.hash} *)
414
val hash_param : int -> int -> 'a -> int
416
@BEGIN_BEFORE_4_00_0@
418
external hash_param :
419
int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc"
421
@BEGIN_BEFORE_3_08_0@
422
external hash_param : int -> int -> 'a -> int = "hash_univ_param" "noalloc"
426
(** @since 4.00.0: val hash_param : int -> int -> 'a -> int
428
external hash_param :
429
int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc"
431
external hash_param : int -> int -> 'a -> int = "hash_univ_param" "noalloc"