
On 10/27/05, Sebastian Sylvan
On 10/27/05, Joel Reymont
wrote: Would it cover the range between minBound :: Word32 and maxBound :: Word32? I cannot figure out how to do this since maxBound :: Int32 is less that that of Word32.
Also, I get the following error with ghci -fglasgow-exts
foo.hs:7:52: parse error on input `.'
Okay, try this then:
import Data.Word import Test.QuickCheck
instance Arbitrary Word32 where arbitrary = do let mx,mn :: Integer mx = fromIntegral (maxBound :: Word32) mn = fromIntegral (minBound :: Word32) c <- choose (mx, mn) return (fromIntegral c)
Sorry, indentation got screwed up there... instance Arbitrary Word32 where arbitrary = do let mx,mn :: Integer mx = fromIntegral (maxBound :: Word32) mn = fromIntegral (minBound :: Word32) c <- choose (mx, mn) return (fromIntegral c)