First order logic in Haskell