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.
Constructors
Instances3Eq, Show, Arbitrary
Eq a => Eq (GenericArbitrary weights a)Defined in generic-random-1.5.0.1 · Generic.Random.DerivingViaShow a => Show (GenericArbitrary weights a)Defined in generic-random-1.5.0.1 · Generic.Random.DerivingVia(GArbitrary UnsizedOpts a, TypeLevelWeights' weights a) => Arbitrary (GenericArbitrary weights a)Defined in generic-random-1.5.0.1 · Generic.Random.DerivingVia