[Haskell-cafe] QuickCheck-like tests with GHC.Generic deriving

lucas di cioccio lucas.dicioccio at gmail.com
Wed Nov 20 07:21:36 UTC 2013


Hi

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.
>

Maybe you can make your data instances of Random

http://hackage.haskell.org/package/random-1.0.0.2/docs/System-Random.html#t:Random

and

https://www.fpcomplete.com/school/starting-with-haskell/libraries-and-frameworks/randoms

--Lucas


> 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
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131120/2940f82c/attachment.html>


More information about the Haskell-Cafe mailing list