
12 Jul
2014
12 Jul
'14
8:08 a.m.
Is this the best we can do in Haskell? Certainly it seems hard to use a QuickCheck/SmallCheck approach for this purpose. Is there any way this kind of testing can be automated or made more robust?
You could make a simple AST which can be used to generate SQL query text directly, and also the Haskell source code for your DSL. Then you can compare the results of the two code paths 'AST -> concrete SQL' and 'AST -> generate Haskell -> run the Haskell -> concrete SQL'. If you can get this working then this could make it easier to use Quickcheck, etc..