Re: [Haskell-cafe] Test.QuickCheck: generate

2009-10-08 Thread Paul Johnson

On 08/10/09 04:57, David Menendez wrote:

On Wed, Oct 7, 2009 at 8:29 PM, Michael Mossey  wrote:
   

In Test.QuickCheck, the type of 'generate' is

generate :: Int ->  StdGen ->  Gen a ->  a

I can't find docs that explain what the Int does. Some docs are here:
 

Judging by the source code, the integer is the upper bound for the
size parameter. If you are generating a list, for example, it gives
the maximum size of the list
Thats right.  Its the "size" parameter, and what it does depends on the 
instance of Arbitrary.  Arbitrary numbers will be within +/- size.  
Arbitrary lists will be of maximum length size.  On the other hand 
arbitrary booleans will just be True or False.



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Test.QuickCheck: generate

2009-10-07 Thread David Menendez
On Wed, Oct 7, 2009 at 8:29 PM, Michael Mossey  wrote:
> In Test.QuickCheck, the type of 'generate' is
>
> generate :: Int -> StdGen -> Gen a -> a
>
> I can't find docs that explain what the Int does. Some docs are here:
>
> 

Judging by the source code, the integer is the upper bound for the
size parameter. If you are generating a list, for example, it gives
the maximum size of the list.

-- 
Dave Menendez 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe