[QuickCheck] Bug: Show broken for Fun values

Koen Claessen koen at chalmers.se
Mon Oct 15 10:13:52 BST 2012


Hi Jannis,

Thanks for the report.

I believe there is a version mix-up and an experimental feature made
it out in production code :-P We will fix this.

Work-around: uncurry your function (use

  Fun (Int,Int) Int

instead of

  Fun Int (Fun Int Int)

)

/Koen

On Tue, Oct 9, 2012 at 11:30 PM, Jannis Harder <jix at jixco.de> wrote:
> 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
>
> _______________________________________________
> QuickCheck mailing list
> QuickCheck at projects.haskell.org
> http://projects.haskell.org/cgi-bin/mailman/listinfo/quickcheck



More information about the QuickCheck mailing list