[Haskell-cafe] QuickCheck Arbitrary - infinite recursion
on recursive GADTs?
Bryan O'Sullivan
bos at serpentine.com
Tue Jun 5 00:17:39 EDT 2007
Marc Weber wrote:
> data A = A INt
> | B [A]
>
> instace Arbitrary A where
> arbitrary = oneof [ liftM A arbitrary
> , liftM B arbitrary
> ]
>
> But now QuickCheck will propably create a test value
> A ( B [ A ( B [ A .... -> no end
>
> Is there an easy QuickCheck way to prevent this?
There are two successive sections in the QuickCheck manual that cover
exactly this topic.
http://www.cs.chalmers.se/~rjmh/QuickCheck/manual_body.html#15
<b
More information about the Haskell-Cafe
mailing list