Module type Hashtbl.HashedType


module type HashedType = sig  end
functor Hashtbl.Make の入力 signature です。


type t
ハッシュテーブルのキーの型です。

val equal : t -> t -> bool
等価かどうか判断します。キーを比較するのに使います。
val hash : t -> int
キーのハッシュ関数です。2 つのキーに対して、equal で等価だと判断される場合は、hash で同じハッシュ値を持つ必要があります。任意のキーの型に対して適用できる (equal, hash) の例として、オブジェクトを構造的に比較する ((=), Hashtbl.hash) や、オブジェクトをアドレスで比較する ((==), Hashtbl.hash) があります。後者の場合は mutable や循環構造のキーに適用できます。