<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 14px; ">I'm learning QuickCheck, and I'm puzzled by the behavior I'm seeing with&nbsp;conditional properties. &nbsp;After writing and loading a simple qsort function from&nbsp;a separate file, I typed these into ghci:</span></div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br>let prop_minimum xs = (length xs > 0) ==> head (qsort xs) == minimum xs<br>&nbsp;&nbsp;where types = xs :: [Integer]<br><br>let prop_minimum1 xs = (length xs > 3) ==> head (qsort xs) == minimum xs<br>&nbsp;&nbsp;where types = xs :: [Integer]<br><br>These differ only in that prop_minimum1 uses a more restrictive condition.<br><br>Then quickCheck prop_minimum outputs<br><br> &nbsp;"OK, passed 100 tests"<br><br>but quickCheck prop_minimum1 outputs<br><br> &nbsp;"Arguments exhausted after 0 tests"<br><br>Investigating with verboseCheck yields puzzling results. &nbsp;For example,&nbsp;verboseCheck prop_minimum says "OK, passed 100 tests", but some of the test&nbsp;instances it shows have length 0, contrary to the condition... and a&nbsp;significant fraction of the test instances have length > 3, or even length >&nbsp;10! &nbsp;So why the problem when running quickCheck on prop_minimum1?<br><br>Running verboseCheck prop_minimum1 just deepens the mystery. &nbsp;Now we see&nbsp;most of the test instances generated having 0 length, and none of them&nbsp;having length > 3. &nbsp;What's going on here? &nbsp;Why is the distribution of&nbsp;generated test instances so drastically altered?<br><br>BTW, I'm using ghc version 6.10.1, running on Intel Mac OS 10.5.5.<br></span></font></div><br></body></html>