
18 Dec
2008
18 Dec
'08
9:24 a.m.
On Wed, Dec 17, 2008 at 11:05 PM, Ryan Ingram
...It's possible to extend this idea and generate an "arbitrary arbitrary"...
Thanks for your thorough answer. I like the SomeArbitrary idea. I see it's easy to also sample[1] SomeArbitrary. You do need to add a 'Show' constraint to the existential 'a' in SomeArbitrary. samplesSomeArbitrary :: IO () samplesSomeArbitrary = mapM_ f =<< sample' arbitrary where f (SomeArbitrary a) = sample (arbitrary `asTypeOf` gen a) where gen :: a -> Gen a gen _ = undefined Thanks, Bas [1] sample: http://hackage.haskell.org/packages/archive/QuickCheck/2.1.0.1/doc/html/Test...