Hoogle Search
Within LTS Haskell 24.10 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
unGenericArbitraryRec :: GenericArbitraryRec (weights :: k) a -> ageneric-random Generic.Random No documentation available.
unGenericArbitraryRecG :: GenericArbitraryRecG (genList :: k) (weights :: k1) a -> ageneric-random Generic.Random No documentation available.
unGenericArbitrarySingle :: GenericArbitrarySingle a -> ageneric-random Generic.Random No documentation available.
unGenericArbitrarySingleG :: GenericArbitrarySingleG (genList :: k) a -> ageneric-random Generic.Random No documentation available.
unGenericArbitraryU :: GenericArbitraryU a -> ageneric-random Generic.Random No documentation available.
unGenericArbitraryUG :: GenericArbitraryUG (genList :: k) a -> ageneric-random Generic.Random No documentation available.
unGenericArbitraryWith :: GenericArbitraryWith (opts :: k) (weights :: k1) a -> ageneric-random Generic.Random No documentation available.
newtype
GenericArbitrary (weights :: k) ageneric-random Generic.Random.DerivingVia Pick a constructor with a given distribution, and fill its fields with recursive calls to arbitrary.
Example
data X = ... deriving Arbitrary via (GenericArbitrary '[2, 3, 5] X)
Picks the first constructor with probability 2/10, the second with probability 3/10, the third with probability 5/10. This newtype does no shrinking. To add generic shrinking, use AndShrinking. Uses genericArbitrary.GenericArbitrary :: a -> GenericArbitrary (weights :: k) ageneric-random Generic.Random.DerivingVia No documentation available.
newtype
GenericArbitraryG (genList :: k) (weights :: k1) ageneric-random Generic.Random.DerivingVia GenericArbitrary with explicit generators.
Example
data X = ... deriving Arbitrary via (GenericArbitraryG CustomGens '[2, 3, 5] X)
where, for example, custom generators to override String and Int fields might look as follows:type CustomGens = CustomString :+ CustomInt
Note on multiple matches
Multiple generators may match a given field: the first will be chosen. This newtype does no shrinking. To add generic shrinking, use AndShrinking. Uses genericArbitraryG.