forked from standardml/cmlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
idict-dataless.sig
35 lines (25 loc) · 1003 Bytes
/
idict-dataless.sig
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
(* This isn't just a set. The idea is the data is part of the key, but
is ignored by the hash and eq functions used to construct the table.
*)
signature DATALESS_IDICT =
sig
type init
type key
type table
exception Absent
val table : init -> table
val reset : table -> init -> unit
val size : table -> int
val member : table -> key -> bool
val insert : table -> key -> unit
val remove : table -> key -> unit
val find : table -> key -> key option
val lookup : table -> key -> key
val lookupOrInsert : table -> key -> key
val lookupOrInsert' : table -> key -> key * bool (* true if already present *)
val swap : table -> key -> key option (* insert and return old entry, if any *)
val toList : table -> key list
val fold : (key * 'b -> 'b) -> 'b -> table -> 'b
val foldLazy : (key * 'b Susp.susp -> 'b) -> 'b -> table -> 'b
val app : (key -> unit) -> table -> unit
end