Bugfix for QuickCheck

Jed Brown jed at 59A2.org
Mon Sep 1 04:39:27 EDT 2008

On Sun 2008-08-31 11:19, Patrick Perry wrote:
> In the old version, "split" gets called n times, so the run time is  
> O(n).  For certain double values, variant gets called with n on the  
> order of 2^30, hence the hang in QuickCheck.  The new version of variant 
> employs the same algorithm as in QuickCheck2.

I haven't looked at this in a while but I'm not sure this completely
fixes things with regard to coarbitrary.  That is, we can produce very
simple Doubles (as defined by arbitrary) that produce (via coarbitrary)
very complicated generators for other types (and there was an issue of
overflow with possible sign change due to nasty casting, hence variant
getting a negative argument).  As I understand it, your fix to variant
means that variant will return in a reasonable amount of time even with
a huge argument, but it doesn't fix the issue that coarbitrary should
produce a `simple' generator for a `simple' argument.  I thought QC2 had
a mechanism to fix this.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/libraries/attachments/20080901/beedfd9c/attachment-0001.bin

More information about the Libraries mailing list