I’d like to use Data.HashSet in Haskell. So I put import Data.HashSet at the beginning of my program. GHCi complains: Could not find module Data.HashSet.
My questions are:
- How can I get Data.HashSet to work?
- I’ve read somewhere that this is part of a hidden module or package. Why is the module hidden? Does “hidden” mean that I should not use it?
- If I should not use it, is there a better alternative for a haskell data structure with a near-constant lookup time?
Data.HashSetis a module in the unordered-containers package, and also in the hashmap package. If you have either package installed,should work out of the box, since it is an exposed module of both packages. To install it (using
unordered-containers, since that is the commonly used one),