[Haskell-cafe] QuickCheck Questions

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Mon Jul 25 06:50:34 CEST 2011


On 25 July 2011 14:31, Mark Spezzano <mark.spezzano at chariot.net.au> wrote:
> Hi Kevin,
>
> Thanks for the response. The first part works well with minor modifications.
>
> Part 2 is still a bit vague to me. I basically want to "clamp" the Integers generated within the Queue to between 0 and some positive number. At present they're giving me numbers all over the place (specifically negative number)

QuickCheck has a NonNegative newtype wrapper you can use for the >=0
criteria; to specify the maximum, use the resize function (the
instance for Int, etc. use the current size parameter as the maximum
value).

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list