Debian Codegraph @

lib/mlrisc-lib/MLRISC/library/hashMap.sig

raw
1 (*
2 * Map datatype that uses hashing.
3 *
4 * -- Allen
5 *)
6
7 signature HASH_MAP =
8 sig
9
10 type ('a,'b) map
11
12 val create : { order : 'a * 'a -> order,
13 hash : 'a -> int,
14 exn : exn
15 } -> int -> ('a,'b) map
16
17 val size : ('a,'b) map -> int
18 val bucketSize : ('a,'b) map -> int
19 val isEmpty : ('a,'b) map -> bool
20 val insert : ('a,'b) map -> ('a * 'b) -> unit
21 val update : ('a,'b) map -> (('a * 'b) * ('b -> 'b)) -> unit
22 val remove : ('a,'b) map -> 'a -> unit
23 val lookup : ('a,'b) map -> 'a -> 'b
24 val lookupOrElse : ('a,'b) map -> 'b -> 'a -> 'b
25 val toList : ('a,'b) map -> ('a * 'b) list
26 val clear : ('a,'b) map -> unit
27 val contains : ('a,'b) map -> 'a -> bool
28 val app : ('a * 'b -> unit) -> ('a,'b) map -> unit
29 val fold : (('a * 'b) * 'c -> 'c) -> 'c -> ('a,'b) map -> 'c
30 val toString : (('a -> string) * ('b -> string)) -> ('a,'b) map
31 -> string
32
33 end
34