-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTable.sig
More file actions
27 lines (21 loc) · 787 Bytes
/
Table.sig
File metadata and controls
27 lines (21 loc) · 787 Bytes
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
(* From Twelf *)
(* Hash Tables *)
(* Author: Frank Pfenning *)
(* Modified: Roberto Virga *)
(* This provides a common interface to hash tables *)
(* red/black trees and similar data structures *)
signature TABLE =
sig
type key (* parameter *)
type 'a entry = key * 'a
type 'a Table
val new : int -> 'a Table (* size hint for some implementations *)
val insert : 'a Table -> 'a entry -> unit
(* insert entry, return shadowed entry if there is one *)
val insertShadow : 'a Table -> 'a entry -> ('a entry) option
val lookup : 'a Table -> key -> 'a option
val delete : 'a Table -> key -> unit
val clear : 'a Table -> unit
(* Apply function to all entries in unpredictable order *)
val app : ('a entry -> unit) -> 'a Table -> unit
end; (* signature TABLE *)