forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhashmap.cppo.mli
50 lines (31 loc) · 979 Bytes
/
hashmap.cppo.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifdef TYPE_STRING
type key = string
#elif defined TYPE_INT
type key = int
#else
[%error "unknown type"]
#endif
type 'b t
val make: int -> 'b t
val clear: 'b t -> unit
val isEmpty: _ t -> bool
val set: 'a t -> key -> 'a -> unit
(** [setDone tbl k v] if [k] does not exist,
add the binding [k,v], otherwise, update the old value with the new
[v]
*)
val copy: 'a t -> 'a t
val get: 'a t -> key -> 'a option
val has: 'b t -> key -> bool
val remove: 'a t -> key -> unit
val forEach: 'b t -> (key -> 'b -> unit [@bs]) -> unit
val reduce: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
val keepMapInPlace: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit
val size: _ t -> int
val toArray: 'a t -> (key * 'a) array
val keysToArray: 'a t -> key array
val valuesToArray: 'a t -> 'a array
val ofArray: (key * 'a) array -> 'a t
val mergeMany: 'a t -> (key * 'a) array -> unit
val getBucketHistogram: _ t -> int array
val logStats: _ t -> unit