Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
class
GGenValid (f :: Type -> Type)genvalidity Data.GenValidity No documentation available.
class
GValidRecursivelyShrink (f :: Type -> Type)genvalidity Data.GenValidity No documentation available.
class
GValidSubterms (f :: Type -> Type) agenvalidity Data.GenValidity No documentation available.
class
GValidSubtermsIncl (f :: Type -> Type) agenvalidity Data.GenValidity No documentation available.
class Validity a =>
GenValid agenvalidity Data.GenValidity A class of types for which valid values can be generated to be valid.
How to instantiate GenValid
Step 1: Try to instantiate GenValid without overriding any functions. It is possible that, if few values are valid or if validity checking is expensive, the resulting generator is too slow. In that case, go to Step 2. Step 2: Consider using genValidStructurallyWithoutExtraChecking and shrinkValidStructurallyWithoutExtraFiltering to speed up generation. This only works if your type has a derived or trivial Validity instance. Step 3: If that still is not fast enough, consider writing your own generator and shrinking function. Make sure to generate any possible valid value, but only valid values.A note about Arbitrary
If you also write Arbitrary instances for GenValid types, it may be best to simply useinstance Arbitrary A where arbitrary = genValid shrink = shrinkValid
gGenValid :: GGenValid f => Gen (f a)genvalidity Data.GenValidity No documentation available.
gValidRecursivelyShrink :: GValidRecursivelyShrink f => f a -> [f a]genvalidity Data.GenValidity No documentation available.
gValidSubterms :: GValidSubterms f a => f a -> [a]genvalidity Data.GenValidity No documentation available.
gValidSubtermsIncl :: GValidSubtermsIncl f a => f a -> [a]genvalidity Data.GenValidity No documentation available.
genValid :: GenValid a => Gen agenvalidity Data.GenValidity Generate a valid datum, this should cover all possible valid values in the type The default implementation is as follows:
genValid = genValidStructurally
To speed up testing, it may be a good idea to implement this yourself. If you do, make sure that it is possible to generate all possible valid data, otherwise your testing may not cover all cases.