Query library for Haskell