[Haskell-cafe] QuickCheck-like tests with GHC.Generic deriving
dag.odenhall at gmail.com
Wed Nov 20 14:37:19 UTC 2013
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.
On Wed, Nov 20, 2013 at 9:02 AM, José Pedro Magalhães <jpm at cs.uu.nl> wrote:
> regular <http://hackage.haskell.org/package/regular-0.3.4> has a generic
> implementation of Arbitrary that even lets you specify size and
> give each constructor a particular frequency (see
> If you find it useful, I'm sure it can be ported to the generic-deriving<http://hackage.haskell.org/package/generic-deriving>package, so that it
> works with GHC.Generics (or maybe to some generic-deriving-extras package
> to avoid
> making generic-deriving depend on QuickCheck).
> On Wed, Nov 20, 2013 at 6:57 AM, Alexander Solla <alex.solla at 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 at haskell.org
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe