What is the best practice to display reasons for a failed property test when it is tested via QuickCheck?
Consider for example:
prop a b = res /= []
where
(res, reason) = checkCode a b
Then the a session could look like:
> quickCheck prop
Falsifiable, after 48 tests:
42
23
But for debugging it would be really convenient to show the reason for failure as part of the quickCheck falsifable report.
I have hacked it like this:
prop a b = if res /= [] then traceShow reason False else True
where
(res, reason) = checkCode a b
Is there is a better/nicer or more quickcheckish way to do it?