I cannot for the life of me figure out how to create and use a hashtbl using the Base library. There are some resources online concerning the standard library hashtbls, but I am not sure if the Base hashtbls are supposed to work the same way because the docs don’t seem to concretely define the type provided as an argument to the create
function (or I could be using the docs wrong because I’m a beginner). I have also tried to follow Ch. 13 of RWO, and did this:
Hashtbl.create ~hashable:String.hash ()
But I get the error:
Error: The function applied to this argument has type
?growth_allowed:bool ->
?size:int -> unit -> ('a, 'b) Base__Hashtbl.t
This argument cannot be applied with label ~hashable
Again, because I don’t know what the type of the arguments are, I don’t even know if Base still uses the ~hashable
optional argument. Has the interface changed?