[Haskell-cafe] Quickcheck

Ozgur Akgun ozgurakgun at gmail.com
Tue Nov 13 22:59:50 CET 2012


hi,

On 13 November 2012 21:52, <graham at fatlazycat.com> wrote:

> prop_something x y = .......do blah with positive integers
>   ==> x > 0 && y > 0
>

quickcheck provides a few nice new types for such cases. try:

prop_something (Positive x) (Positive y) = ...

this way qc only generates positive numbers, instead of generating and
discarding some.

hth,

-- 
Ozgur Akgun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121113/207f254b/attachment.htm>


More information about the Haskell-Cafe mailing list