h$IB7      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None'(./5>?.,>generic-randomGet the name contained in a  tag.generic-random"Given a list of custom generators g :+ gs!, find one that applies, or use  Arbitrary a by default.g and gs" follow this little state machine:  g, gs | result ---------------------+----------------------------- (), () | END (), g :+ gs | g, gs (), g | g, () when g is not (_ :+ _) g :+ h, gs | g, h :+ gs Gen a, gs | END if g matches, else ((), gs) FieldGen a, gs | idem ConstrGen a, gs | idem Gen1 a, gs | idem Gen1_ a, gs | idemgeneric-randomGeneric Arbitrarygeneric-randomGeneric Arbitrarygeneric-randomCustom generators for unary type constructors that are not "containers", i.e., which don't require a generator of a to generate an f a.A custom generator  f5 will be used for any field whose type has the form f x.generic-random+Custom generators for "containers" of kind  Type -> Type;, parameterized by the generator for "contained elements".A custom generator  f5 will be used for any field whose type has the form f x, requiring a generator of x. The generator for x will be constructed using the list of custom generators if possible, otherwise an instance  Arbitrary x will be required.!generic-randomCustom generator for the i#-th field of the constructor named c. Fields are 0-indexed.$generic-random)Custom generator for record fields named s.If there is a field named s: with a different type, this will result in a type error.+generic-random!Heterogeneous list of generators.-generic-random+Match this generator incoherently when the 2 option is set.0generic-randomFor custom generators to work with parameterized types, incoherent instances must be used internally. In practice, the resulting behavior is what users want 100% of the time, so you should forget this option even exists.DetailsThe default configuration of generic-random does a decent job if we trust GHC implements precisely the instance resolution algorithm as described in the GHC manual: https://downloads.haskell.org/ghc/latest/docs/html/users_guide/glasgow_exts.html#overlapping-instancesWhile that assumption holds in practice, it is overly context-dependent (to know the context leading to a particular choice, we must replay the whole resolution algorithm). In particular, this algorithm may find one solution, but it is not guaranteed to be unique: the behavior of the program is dependent on implementation details.An notable property to consider of an implicit type system (such as type classes) is coherence: the behavior of the program is stable under specialization.This sounds nice on paper, but actually leads to surprising behavior for generic implementations with parameterized types, such as generic-random.To address that, the coherence property can be relaxd by users, by explicitly allowing some custom generators to be chosen incoherently. With appropriate precautions, it is possible to ensure a weaker property which nevertheless helps keep type inference predictable: when a solution is found, it is unique. (This is assuredly weaker, i.e., is not stable under specialization.)1generic-random%Match custom generators incoherently.2generic-randomMatch custom generators coherently by default (can be manually bypassed with -).6generic-randomWhether to decrease the size parameter before generating fields.The 7 option makes the size parameter decrease in the following way: - Constructors with one field decrease the size parameter by 1 to generate that field. - Constructors with more than one field split the size parameter among all fields; the size parameter is rounded down to then be divided equally.7generic-random>Decrease the size parameter when running generators for fields8generic-randomDon't touch the size parameter9generic-randomLike <*, but using coherent instances by default.:generic-randomLike =*, but using coherent instances by default.>generic-randomInfix flipped synonym for @.?generic-random Setter for @.!This subsumes the other setters: 4, 3, '.@generic-randomType-level options for .2Note: it is recommended to avoid referring to the @ type explicitly in code, as the set of options may change in the future. Instead, use the provided synonyms (=, <, ;) and the setter ? (abbreviated as (>)).Cgeneric-random1Derived uniform distribution of constructors for a.Kgeneric-random6A binary constructor for building up trees of weights.Ogeneric-randomType of a single weight, tagged with the name of the associated constructor for additional compile-time checking. ((9 :: O "Leaf") K (8 :: O "Node") K ()) Qgeneric-random2Trees of weights assigned to constructors of type a1, rescaled to obtain a probability distribution.Two ways of constructing them. (x1 K x2 K ... K xn K ()) :: Q a b :: Q a Using (K), there must be exactly as many weights as there are constructors.b is equivalent to (1 K ... K 1 K ())3 (automatically fills out the right number of 1s).Xgeneric-randomPick a constructor with a given distribution, and fill its fields with recursive calls to .Example *genericArbitrary (2 % 3 % 5 % ()) :: Gen a-Picks the first constructor with probability 2/10, the second with probability 3/10, the third with probability 5/10.Ygeneric-random>Pick every constructor with equal probability. Equivalent to X b. genericArbitraryU :: Gen aZgeneric-random0 for types with one constructor. Equivalent to Y, with a stricter type. genericArbitrarySingle :: Gen a[generic-randomDecrease size at every recursive call, but don't do anything different at size 0. /genericArbitraryRec (7 % 11 % 13 % ()) :: Gen a5N.B.: This replaces the generator for fields of type [t] with o arbitrary instead of  arbitrary (i.e.,  arbitrary for lists).\generic-randomX with explicit generators.Example +genericArbitraryG customGens (17 % 19 % ())where, the generators for  and 0 fields are overridden as follows, for example: customGens :: Gen String ++ Gen Int customGens = (filter (/= 'NUL')  arbitrary) + (getNonNegative  arbitrary) Note on multiple matchesMultiple generators may match a given field: the first will be chosen.]generic-randomY% with explicit generators. See also \.^generic-randomZ% with explicit generators. See also \._generic-random[% with explicit generators. See also \.`generic-random.General generic generator with custom options.ageneric-randomA smart constructor to specify a custom distribution. It can be omitted for the K& operator is overloaded to insert it.bgeneric-randomUniform distribution.cgeneric-random Coerce an @2 value between types with the same representation.dgeneric-random'Default options for unsized generators.egeneric-random%Default options for sized generators.fgeneric-random4Default options overriding the list generator using o.ggeneric-randomLike d*, but using coherent instances by default.hgeneric-randomLike e) but using coherent instances by default.kgeneric-random$Define the set of custom generators.Note: for recursive types which can recursively appear inside lists or other containers, you may want to include a custom generator to decrease the size when generating such containers.!See also the Note about lists in !Generic.Random.Tutorial#notelists.lgeneric-random$3 constructor with the field name given via a proxy.mgeneric-random!9 constructor with the constructor name given via a proxy.ngeneric-randomAn alternative to < that divides the size parameter by the length of the list.ogeneric-randomAn alternative to  that divides the size parameter by the length of the list. The length follows a geometric distribution of parameter 1/(sqrt size + 1).pgeneric-randomAn alternative to  (nonempty lists) that divides the size parameter by the length of the list. The length (minus one) follows a geometric distribution of parameter 1/(sqrt size + 1).qgeneric-random$Geometric distribution of parameter 1/(sqrt n + 1) (n >= 0).generic-randomMatching custom generator for i-th field of constructor c.generic-random$Matching custom generator for field s.generic-randomMatching custom generator for i-th field of constructor c.generic-random$Matching custom generator for field s.generic-random,Matching custom generator for non-container f.generic-randomMatching custom generator for a.generic-random>None of the INCOHERENT instances match, discard the candidate g# and look at the rest of the list gs.generic-randomThis can happen if the generators form a tree rather than a list, for whatever reason.generic-randomExamine the last candidate (g is not of the form _ :+ _)generic-randomExamine the next candidategeneric-random"All candidates have been exhaustedgeneric-random#If none of the above matches, then g should be a simple generator, and we test whether it matches the type a.generic-random(Matching custom generator for container f!. Start the search for containee a , discarding field information.Xgeneric-random%List of weights for every constructor[generic-random%List of weights for every constructor_generic-random%List of weights for every constructor   !"#$%&'()*+,-./0213456879:;<=>?@ABCDEFGIHJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstXYZ[\]^_`WUVSTQROPabNMLJKGIHEFDC@AB?>=<;:9cdefgh687543ij021/-.+,*()k'$%&l!"#m nopqr  st+1,1>1K1None./9>?4generic-random3Custom instances can override the default behavior.generic-randomGenerator of base cases.generic-random+Progressively increase the depth bound for .generic-randomFind a base case of type a with maximum depth z, recursively using # instances to search deeper levels.y' is the depth of a base case, if found.e4 is the original type the search started with, that a- appears in. It is used for error reporting.generic-randomDecrease size to ensure termination for recursive types, looking for base cases once the size reaches 0. .genericArbitrary' (17 % 19 % 23 % ()) :: Gen a5N.B.: This replaces the generator for fields of type [t] with  arbitrary instead of  arbitrary (i.e.,  arbitrary for lists).generic-randomEquivalent to  b. genericArbitraryU' :: Gen a5N.B.: This replaces the generator for fields of type [t] with  arbitrary instead of  arbitrary (i.e.,  arbitrary for lists).generic-randomRun the first generator if the size is positive. Run the second if the size is zero. %defaultGen `withBaseCase` baseCaseGengeneric-random Overlappablegeneric-random%List of weights for every constructor!!None'(-./>?@L generic-randomgeneric-randomgeneric-random/Add generic shrinking to a newtype wrapper for , using . 'data X = ... deriving Arbitrary via ( '[1,2,3] `` X) Equivalent to: )instance Arbitrary X where arbitrary = X (1 % 2 % 3 % ()) shrink =  generic-random.General generic generator with custom options.>This newtype does no shrinking. To add generic shrinking, use .Uses `.generic-random[% with explicit generators. See also \.>This newtype does no shrinking. To add generic shrinking, use .Uses _.generic-randomZ% with explicit generators. See also .>This newtype does no shrinking. To add generic shrinking, use .Uses ^.generic-random% with explicit generators. See also .>This newtype does no shrinking. To add generic shrinking, use .Uses ].generic-random with explicit generators.Example data X = ... deriving Arbitrary via (GenericArbitraryG CustomGens '[2, 3, 5] X)2where, for example, custom generators to override  and  fields might look as follows: type CustomGens = CustomString + CustomInt Note on multiple matchesMultiple generators may match a given field: the first will be chosen.>This newtype does no shrinking. To add generic shrinking, use .Uses \.generic-randomDecrease size at every recursive call, but don't do anything different at size 0. data X = ... deriving Arbitrary via (GenericArbitraryRec '[2, 3, 5] X)5N.B.: This replaces the generator for fields of type [t] with o arbitrary instead of  arbitrary (i.e.,  arbitrary for lists).>This newtype does no shrinking. To add generic shrinking, use .Uses [.generic-random arbitrary0 for types with one constructor. Equivalent to , with a stricter type.>This newtype does no shrinking. To add generic shrinking, use .Uses Z.generic-random.Pick every constructor with equal probability.>This newtype does no shrinking. To add generic shrinking, use .Uses Y.generic-randomPick a constructor with a given distribution, and fill its fields with recursive calls to .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 .Uses X.##None@ !"#$%&'+,-.012346789:;<=>?@CKOQXYZ[\]^_`bcdefghijklmnopXYZ[\]^_QOKb+,$%&l!"#m opn@`?>c67843ij'k012-.?@ABCCDEFGHIJKLMNOPQQRRSSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-generic-random-1.5.0.1-CYrdvQgP6CEKJPC3rKeWMYGeneric.Random.Internal.GenericGeneric.Random Generic.Random.Internal.BaseCaseGeneric.Random.DerivingViaTest.QuickChecklistOflistOf1listOf'Generic.Random.TutorialWeightedMatchesNameDummySelASelOf ACoherenceOf FullGenListOfASelAStoreSAInstrShiftMatchMatchCohFindGenfindGenArity GAProduct' gaProduct' GAProduct gaProductGASumgaSum GArbitraryGAgaGen1_unGen1_Gen1unGen1 ConstrGen unConstrGenFieldGen unFieldGenSetGens HasGenerators generators GeneratorsOf:+ Incoherent CoherenceOf Coherence INCOHERENTCOHERENT SetUnsizedSetSizedSizingOfSizingSizedUnsized CohSizedOptsCohUnsizedOpts SizedOptsDef SizedOpts UnsizedOpts<+ SetOptionsOptions _generatorsGUniformWeightUniformWeight_ UniformWeight uniformWeight WeightBuilderPrec%.WeightBuilder'%Prec'First'FirstWWeightsL:|NWeights_genericArbitrarygenericArbitraryUgenericArbitrarySinglegenericArbitraryRecgenericArbitraryGgenericArbitraryUGgenericArbitrarySingleGgenericArbitraryRecGgenericArbitraryWithweightsuniformsetOpts unsizedOpts sizedOpts sizedOptsDefcohUnsizedOpts cohSizedOptssetSized setUnsized setGeneratorsfieldGen constrGen vectorOf'listOf1'geomgaSum'iShiftliftGen$fWeightBuilder()$fWeightBuilderL$fWeightBuilder:|$fWeightBuilder'(,,)$fWeightBuilder'Weights$fUniformWeight()$fUniformWeightL$fUniformWeight:|$fUniformWeight_f$fGUniformWeighta$fHasGeneratorsOptions $fGAoptsM1$fGArbitraryoptsa$fGASumopts:+: $fGAopts:+:$fGAProductkSizedcoptsU1$fGAProduct'kcioptsU1$fGAProductkSizedcoptsM1$fGAProductkUnsizedcoptsf$fGAProduct'kciopts:*:$fGAProductkSizedcoptsf$fFindGenMatchCohsConstrGengsa'$fFindGenMatchCohsFieldGengsa'$fFindGenMatchCohsGen1_gsa'$fFindGenMatchCohsGengsa'$fFindGenMatchCohs_ggsa$fFindGenMatchSConstrGengsa'$fFindGenMatchSFieldGengsa'$fFindGenMatchsGen1_gsf$fFindGenMatchsGengsa$fFindGenMatchs_ggsa$fFindGenShiftsIncoherentgsa$fFindGenShifts:+gsa$fFindGenShifts()ga$fFindGenShifts():+a$fFindGenShifts()()a$fFindGenShiftsggsa$fFindGenMatchCohSGen1gsa'$fFindGenMatchSGen1gsf$fGAProduct'kcioptsM1 $fGASumoptsM1 $fGAoptsM10$fFindGenMatchsggsa$fAlternativeWeighted$fApplicativeWeighted$fFunctorWeighted$fNumWGBaseCaseSearchgBaseCaseSearchIsMaybeifMmapifM GBCSProduct gbcsProductGBCSSumComparegbcsSumCompareGBCSSumgbcsSumGBCSgbcsMinOfMinMaxOfMax&&?||?IsEQ==IfMBaseCasebaseCaseBaseCaseSearchingbaseCaseSearchingBaseCaseSearching_baseCaseSearching_BaseCaseSearchbaseCaseSearchgenericArbitrary'genericArbitraryU' withBaseCase $fBaseCasea!$fBaseCaseSearching_NattazNothing$fBaseCaseSearching_ktazJust$fBaseCaseSearchingNataz$fBaseCaseSearchOrderingzye$fBaseCaseSearch[]zye$fBaseCaseSearchBoolzye$fBaseCaseSearch()zye$fBaseCaseSearchWordzye$fBaseCaseSearchDoublezye$fBaseCaseSearchFloatzye$fBaseCaseSearchIntegerzye$fBaseCaseSearchIntzye$fBaseCaseSearchCharzye $fGBCSkfzye $fGBCSkU1zye $fGBCSkK10ye $fGBCSkM1zye$fGBCSSumkkkfgzeNothingJust$fGBCSSumkkkfgzeJustNothing$fGBCSSumkkkfgzeNothingNothing $fGBCSk:+:zye!$fGBCSSumComparekkkOrderingfgzeGT!$fGBCSSumComparekkkOrderingfgzeLT!$fGBCSSumComparekkkOrderingfgzeEQ$fGBCSSumkkkfgzeJustJust$fGBCSProductkkkfgzeJustJust$fGBCSProductkkkfgzeyfyg $fGBCSk:*:zye $fGBCSkK1zye$fIsMaybetNothing$fIsMaybetJust$fGBaseCaseSearchNatNatTYPEazye$fBaseCaseSearchazye TypeLevelOptsTypeLevelOpts'toOptsTypeLevelGenListTypeLevelGenList' toGenList AndShrinkingGenericArbitraryWithunGenericArbitraryWithGenericArbitraryRecGunGenericArbitraryRecGGenericArbitrarySingleGunGenericArbitrarySingleGGenericArbitraryUGunGenericArbitraryUGGenericArbitraryGunGenericArbitraryGGenericArbitraryRecunGenericArbitraryRecGenericArbitrarySingleunGenericArbitrarySingleGenericArbitraryUunGenericArbitraryUGenericArbitraryunGenericArbitrary$fArbitraryGenericArbitraryU!$fArbitraryGenericArbitrarySingle$fArbitraryAndShrinking$fTypeLevelWeights[][]()$fTypeLevelWeights[]::|$fTypeLevelWeights[]:L$fTypeLevelWeights[]::|0$fArbitraryGenericArbitraryRec$fArbitraryGenericArbitrary$fTypeLevelGenListTYPE:+$fTypeLevelGenListTYPEGen$fArbitraryGenericArbitraryRecG"$fArbitraryGenericArbitrarySingleG$fArbitraryGenericArbitraryUG$fArbitraryGenericArbitraryG$fArbitraryGenericArbitraryWith$fEqAndShrinking$fShowAndShrinking$fEqGenericArbitraryWith$fShowGenericArbitraryWith$fEqGenericArbitraryRecG$fShowGenericArbitraryRecG$fEqGenericArbitrarySingleG$fShowGenericArbitrarySingleG$fEqGenericArbitraryUG$fShowGenericArbitraryUG$fEqGenericArbitraryG$fShowGenericArbitraryG$fEqGenericArbitraryRec$fShowGenericArbitraryRec$fEqGenericArbitrarySingle$fShowGenericArbitrarySingle$fEqGenericArbitraryU$fShowGenericArbitraryU$fEqGenericArbitrary$fShowGenericArbitrarybase GHC.GenericsMeta'QuickCheck-2.14.2-6vGnep5JveBx6Bsl9Nf1tTest.QuickCheck.Arbitrary arbitraryGHC.BaseStringghc-prim GHC.TypesInt Data.Functor<$>Test.QuickCheck.GenvectorOf Arbitrary genericShrink