<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Is this the best we can do in Haskell?  Certainly it seems hard to use a<br>
QuickCheck/SmallCheck approach for this purpose.  Is there any way this kind<br>
of testing can be automated or made more robust?<br></blockquote><div><br></div><div><div><div>You could make a simple AST which can be used to generate SQL query</div><div>text directly, and also the Haskell source code for your DSL. Then you</div>
<div>can compare the results of the two code paths 'AST -> concrete SQL'</div><div>and 'AST -> generate Haskell -> run the Haskell -> concrete SQL'. If</div><div>you can get this working then this could make it easier to use</div>
<div>Quickcheck, etc..</div></div></div><div><br></div></div></div></div>