1Hashtbl.HashedType(3) OCaml library Hashtbl.HashedType(3)
2
3
4
6 Hashtbl.HashedType - The input signature of the functor Hashtbl.Make.
7
9 Module type Hashtbl.HashedType
10
12 Module type HashedType
13 = sig end
14
15
16 The input signature of the functor Hashtbl.Make .
17
18
19
20
21
22 type t
23
24
25 The type of the hashtable keys.
26
27
28
29 val equal : t -> t -> bool
30
31 The equality predicate used to compare keys.
32
33
34
35 val hash : t -> int
36
37 A hashing function on keys. It must be such that if two keys are equal
38 according to equal , then they have identical hash values as computed
39 by hash . Examples: suitable ( equal , hash ) pairs for arbitrary key
40 types include
41
42 - ( (=) , Hashtbl.HashedType.hash ) for comparing objects by
43 structure (provided objects do not contain floats)
44
45 - ( (fun x y -> compare x y = 0) , Hashtbl.HashedType.hash ) for
46 comparing objects by structure and handling nan correctly
47
48 - ( (==) , Hashtbl.HashedType.hash ) for comparing objects by
49 physical equality (e.g. for mutable or cyclic objects).
50
51
52
53
54
55
56OCamldoc 2022-07-22 Hashtbl.HashedType(3)