On Tue, Dec 18, 2012 at 05:25:41PM +0000, [email protected] wrote:
> Are there any libraries that define various common generators ?
> 
> What would be the cleanest way to define two positive integers below
> 1000 that are different ? Seems relatively easy with conditionals.

You can still use (==>) to ensure that two numbers are different.  I
would use something like this:

    newtype Small = Small Int
      deriving Show

    instance Arbitrary Small where
      arbitrary = Small . (`mod` 1000) <$> arbitrary

    prop_foo (Small x) (Small y) = x /= y ==> ...

Cheers,
Simon

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to