There’s a branch adding support for Generic
deriving of Arbitrary
, more than a year old. I always wondered why it was never merged into master and released on Hackage.
Cheers,making generic-deriving depend on QuickCheck).If you find it useful, I'm sure it can be ported to the generic-deriving package, so that itHello,regular has a generic implementation of Arbitrary that even lets you specify size and
give each constructor a particular frequency (see Generics.Regular.Functions.Arbitrary).
works with GHC.Generics (or maybe to some generic-deriving-extras package to avoid
PedroOn Wed, Nov 20, 2013 at 6:57 AM, Alexander Solla <alex.solla@gmail.com> wrote:
I am looking for a QuickCheck-like test framework which exposes data generators (like QuickCheck's Arbitrary class) with Generic defaults.I have seen that SmallCheck's Serial class has Generic defaults, but it isn't particularly good for my purpose (I'd like to use the generator to populate deeply nested data types, and SmallCheck's generator requires computing a few million values before I get any interesting ones) Something "random" would be more useful for my purpose.I know that the plan depends on my vaguely abusing the test-case generator, but I plan on doing some testing anyway, so I figured I should reuse the instance.That said, I'd be willing to use any random value type class with Generic-default instances.Does anybody have any suggestions?_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe