[QuickCheck] Bug: Show broken for Fun values

Jannis Harder jix at jixco.de
Tue Oct 9 22:30:08 BST 2012


The changes to shrinking of Fun values introduced in commit 7ceb866d
"An attempt at allowing partial showable functions" result in a discard
exception being thrown during show sometimes. 

This can be reproduced in ghci as follows:
> :m + Test.QuickCheck Test.QuickCheck.Function
> quickCheck (const False :: Fun Int (Fun Int Int) -> Bool)
*** Failed!  (after 1 test and 2 shrinks):
{Exception thrown by generator: 'DISCARD. You should not see this exception, it is internal to QuickCheck.'

This example is pretty silly, but I ran across this bug while writing a
larger real test I was working on.

As a workaround I just changed the use of whenever back to list
comprehension guards, but I guess the change had some intended effect in
the first place.

Regards,
Jannis



More information about the QuickCheck mailing list