I think this creates arbitrary lists of length three, but how do I create lists of arbitrary length?
import Test.QuickCheck
data List a =
Nil
| Cons a (List a)
deriving (Eq, Show)
instance Arbitrary a => Arbitrary (List a) where
arbitrary = do
a <- arbitrary
a' <- arbitrary
a'' <- arbitrary
return $ (Cons a (Cons a' (Cons a'' (Nil))))