
4 Dec
2007
4 Dec
'07
10:41 a.m.
Steffen Mazanek wrote:
Hello,
I want to quickcheck a property on a datatype representing programs (=[Stmt]) and need to define a specific instance
instance Arbitrary [Stmt]
(mainly to restrict the size of the list).
you don't always need to use instances. for example, I have (where Predicate is a type I defined which I gave a separate normal Arbitrary instance) arbpredicate :: Gen Predicate arbpredicate = do ... prop_assocUnify :: Property prop_assocUnify = forAll arbpredicate $ \a -> forAll arbpredicate $ \b -> forAll arbpredicate $ \c -> ...boolean result Isaac