ghc-generic-random 1.2.0.0 Generic random generators for QuickCheck
Derive instances of Arbitrary
for QuickCheck, with various options to customize implementations.
Automating the arbitrary boilerplate also ensures that when a type changes to have more or fewer constructors, then the generator either fixes itself to generate that new case (when using the uniform distribution) or causes a compilation error so you remember to fix it (when using an explicit distribution).
This package also offers a simple (optional) strategy to ensure termination for recursive types: make Test.QuickCheck.Gen
's size parameter decrease at every recursive call; when it reaches zero, sample directly from a trivially terminating generator given explicitly (genericArbitraryRec
and withBaseCase
) or implicitly (genericArbitrary'
).
- Website: https://github.com/lysxia/generic-random
- License: Expat
- Package source: haskell-xyz.scm
- Patches: None
- Builds: x86_64-linux, i686-linux