[QuickCheck] Default value for "ok result" undefined

fro_ozen fro_ozen at gmx.de
Tue Mar 31 19:27:33 BST 2015


Hello QuickCheck mailinglist,

this might no necessarily be a bug, but the default value of the "ok"
record field of the Result
returned by the "result" function in the Test.QuickCheck.Property module
is undefined.

This is not what one would expect from a Maybe type.
The undefined can make for some nasty and hard to trace bugs in your
tests if you, for example,
use the Result in a fold (like I did here
<https://github.com/froozen/kademlia/blob/master/test/Tree.hs#L57>) or
try to check the value for some other reason.

I would therefore propose to make the default value a "Nothing" or to
warn about it in the documentation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/quickcheck/attachments/20150331/e8ba3e16/attachment.htm>


More information about the QuickCheck mailing list