
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. Jed