On Wed, Dec 17, 2008 at 11:05 PM, Ryan Ingram <[email protected]> wrote:
> ...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-QuickCheck.html#v%3Asample
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe