
27 Oct
2005
27 Oct
'05
7:11 p.m.
On Thu, 27 Oct 2005, Sebastian Sylvan
instance Arbitrary Word32 where arbitrary = do c <- arbitrary :: Gen Integer return (fromIntegral c)
This definition will usually only generate very small or very large Word32 values. The reason is the wrapping mentioned elsewhere and the arbitrary definition for Integer: arbitrary = sized $ \n -> choose (-fromIntegral n,fromIntegral n) You would need to manually ask for larger sizes (using Test.QuickCheck.check with a suitable Config). If a uniform distribution of Word32s is really needed then I would go with the other definition. -- /NAD