let is pick any character from any position in a list since we only
have 256 options anyhow
all tests pass.
random g = randomR (minBound, maxBound) g
instance Arbitrary Char where
random g = randomR (minBound, maxBound) g
instance Arbitrary Char where
- arbitrary = sized $ \n -> choose (toEnum 0, min (toEnum (n * 0x50)) '\xFF')
+ arbitrary = sized $ \n -> choose ('\NUL', '\xFF')
coarbitrary n = variant (toEnum (2 * x + 1))
where x = (abs . fromEnum $ n)::Int
coarbitrary n = variant (toEnum (2 * x + 1))
where x = (abs . fromEnum $ n)::Int