0

I would like to construct a couple of "dictionaries" in Haskell as part of a project I am working on. I was wondering what would be some efficient data structures for doing so. A very naive approach would be to use a list of tuples, but I suspect that this would be quite inefficient.

Any suggestions would be most welcome!

P.S. I am creating this dictionaries by reading a corpus of raw text as the keys and some scores about the words as values.

user2864740
  • 60,010
  • 15
  • 145
  • 220
Orest Xherija
  • 434
  • 4
  • 18
  • 4
    How is efficiency measured here? Which operations and what expected/required bounds? – user2864740 Dec 04 '16 at 19:52
  • 3
    Check out [`containers`](https://hackage.haskell.org/package/containers) (not hashed based) and [`unordered-containers`](https://hackage.haskell.org/package/unordered-containers) (hash based). – Alec Dec 04 '16 at 20:05
  • 1
    @duplode, I think it is, thanks for pointing that out! – Orest Xherija Dec 04 '16 at 20:31

0 Answers0