Hashtbl.Make vs. Hashtbl.create -- when to use what?

Polymorphic compare is appropriate to use with values where the notion of “equality” you want is the same as “structural” equality. Things like ordinary variants, records, lists, arrays, primitives, etc. A data structure where this might not work correctly is, for example, binary search trees representing sets, where two different tree structures may still represent the same set of elements.

Jane Street’s libraries discourage the use of polymorphic compare altogether (see this thread for example).

I agree that if unspecified, it is reasonable to assume the standard library. My question was intended more as just a confirmation that we were talking about the same thing. Sorry if that was confusing.

I believe so. That is the right function name. I think they use the same hash function, as well, although the tables themselves are represented differently.

Prost!

2 Likes