New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sized QuickCheck properties to avoid blowup #23
Conversation
Thanks a lot. Could you please add comments explaining the design/choices? |
Also, please use |
Sure, will do, when I get a moment. I wasn't aware of |
Thanks.
So it annoys me to see it used when the numerator and denominator are known to be non-negative. |
Makes sense, thanks. How's this? |
Sorry, I meant to use a different account for these commits. One second. |
d37e7d0
to
1cb58f8
Compare
Ok, this is ready to re-review/merge. |
Almost there! I have just one last request before I merge. The |
Cool. How's this? |
Ah, I suppose we might want to import |
Definitely. Thanks again.
|
Be sure to use MIN_VERSION_base to check--it's the polite way.
|
I've tested this with GHC 7.8.4 and 7.10.3. :) |
Sized QuickCheck properties to avoid blowup
Perfect. Merged! |
Actually, one last question! Shouldn't the size be reduced by at most a fixed constant amount in the |
I don't really know, but this seemed to work and the sample seemed reasonable :) I have a suspicion that we might still suffer from the original problem if we do that, but I can give it a try. What fixed constant amount did you have in mind? |
I don't think we'll suffer the original problem even if we don't resize
|
TBH, the whole size thing strikes me as rather ad hoc, a flaw in
|
Hm, yes. I'm not sure how I'd even go about designing an alternative that didn't have it, though... It appears I was wrong; still works fine if we only decrement by 1 for SubBox. Here's a sample:
|
FYI, here's my intuition: a SubBox is only larger than its contents by one
|
Right, yeah, that makes sense. I agree. |
Resolves #16. Here's a sample of what these generators produce (via
Test.QuickCheck.sample
):