签名 mkTable
值是:
val mkTable : (('a -> word) * (('a * 'a) -> bool)) -> (int * exn)
-> ('a,'b) hash_table
(* Given a hashing function and an equality predicate, create a new table;
* the int is a size hint and the exception is to be raised by find.
*)
因此,您必须做类似的事情:
val ht : (string, int) HashTable.hash_table =
HashTable.mkTable (HashString.hashString, op=) (42, Fail "not found")