Haskell library for indices with gratuitous optimisations