The obvious difference between Data.Map
and Data.HashMap
is that the former needs keys in Ord
, the latter Hashable
keys. Most of the common keys are both, so that's not a deciding criterion. I have no experience whatsoever with Data.HashTable
, so I can't comment on that.
The APIs of Data.HashMap
and Data.Map
are very similar, but Data.Map
exports more functions, some, like alter
are absent in Data.HashMap
, others are provided in strict and non-strict variants, while Data.HashMap
(I assume you meant the hashmap from unordered-containers) provides lazy and strict APIs in separate modules. If you are using only the common part of the API, switching is really painless.
Concerning performance, Data.HashMap
of unordered-containers has pretty fast lookup, last I measured, it was clearly faster than Data.IntMap
or Data.Map
, that holds in particular for the (not yet released) HAMT branch of unordered-containers. I think for inserts, it was more or less on par with Data.IntMap
and somewhat faster than Data.Map
, but I'm a bit fuzzy on that.
Both are sufficiently performant for most tasks, for those tasks where they aren't, you'll probably need a tailor-made solution anyway. Considering that you ask specifically about lookups, I would give Data.HashMap
the edge.