
13 Aug
2008
13 Aug
'08
7:58 p.m.
The bug is in the "variant" function in QuickCheck. I replaced variant :: Int -> Gen a -> Gen a variant v (Gen m) = Gen (\n r -> m n (rands r !! (v+1)) where rands r0 = r1 : rands r2 where (r1, r2) = split r0 with variant :: Int -> Gen a -> Gen a variant v (Gen m) = Gen (\n r -> m n (rands r !! v')) where v' = abs (v+1) `mod` 10000 rands r0 = r1 : rands r2 where (r1, r2) = split r0 and now everything works fine. "10000" seems like a reasonable value here, but one could hard-code a lower or higher value as well. Can someone make sure this gets fixed in the next version of QuickCheck? I'm not sure who the maintainer is. Patrick