sql parser and type checker in haskell