5&      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        Safe:Shrink an integral number by edging towards a destination. towards 0 100[0,50,75,88,94,97,99]towards 500 1000%[500,750,875,938,969,985,993,997,999]towards (-50) (-26)[-50,-38,-32,-29,-27]HNote we always try the destination first, as that is the optimal shrink.?Shrink a floating-point number by edging towards a destination.take 7 (towardsFloat 0.0 100))[0.0,50.0,75.0,87.5,93.75,96.875,98.4375]take 7 (towardsFloat 1.0 0.5)2[1.0,0.75,0.625,0.5625,0.53125,0.515625,0.5078125]HNote we always try the destination first, as that is the optimal shrink./Shrink a list by edging towards the empty list. list [1,2,3][[],[2,3],[1,3],[1,2]] list "abcd"&["","cd","ab","bcd","acd","abd","abc"]GNote we always try the empty list first, as that is the optimal shrink.%Produce all permutations of removing k elements from a list.removes 2 "abcdef"["cdef","abef","abcd"]AProduce a list containing the progressive halving of an integral. halves 15 [15,7,3,1] halves 100[100,50,25,12,6,3,1] halves (-26)[-26,-13,-6,-3,-1]ECons an element on to the front of a list unless it is already there.None %A splittable random number generator. must be an odd number Create a random ) using an effectful source of randomness.  Create a  using an . NA predefined gamma value's needed for initializing the "root" instances of O. That is, instances not produced by splitting an already existing instance.&We choose: the odd integer closest to 2^64/, where  = (1 + "5)/2 is the golden ratio.,Get the next value in the SplitMix sequence. +Splits a random number generator in to two.Generate a random .Generate a random .Generate a random $ in the [inclusive,inclusive] range.Generate a random $ in the [inclusive,exclusive) range.     NoneI`A range describes the bounds of a number to generate, which may or may not be dependent on a .Tests are parameterized by the size of the randomly-generated data, the meaning of which depends on the particular generator used. uGet the origin of a range. This might be the mid-point or the lower bound, depending on what the range represents.The !; of a range are scaled around this value when using the ( family of combinators. When using a O to generate numbers, the shrinking function will shrink towards the origin.!-Get the extents of a range, for a given size."2Get the lower bound of a range for the given size.#2Get the upper bound of a range for the given size.$;Construct a range which represents a constant single value.bounds x $ singleton 5(5,5)origin $ singleton 55%<Construct a range which is unaffected by the size parameter. A range from 0 to 10, with the origin at 0:bounds x $ constant 0 10(0,10)origin $ constant 0 100&tConstruct a range which is unaffected by the size parameter with a origin point which may differ from the bounds. A range from -10 to 10, with the origin at 0:"bounds x $ constantFrom 0 (-10) 10(-10,10) origin $ constantFrom 0 (-10) 100 A range from 1970 to 2100, with the origin at 2000:&bounds x $ constantFrom 2000 1970 2100 (1970,2100)$origin $ constantFrom 2000 1970 21002000'cConstruct a range which is unaffected by the size parameter using the full range of a data type. A range from -128 to 127, with the origin at 0:(bounds x (constantBounded :: Range Int8) (-128,127)&origin (constantBounded :: Range Int8)0(RConstruct a range which scales the second bound relative to the size parameter.bounds 0 $ linear 0 10(0,0)bounds 50 $ linear 0 10(0,5)bounds 99 $ linear 0 10(0,10))IConstruct a range which scales the bounds relative to the size parameter. bounds 0 $ linearFrom 0 (-10) 10(0,0)!bounds 50 $ linearFrom 0 (-10) 20(-5,10)!bounds 99 $ linearFrom 0 (-10) 20(-10,20)*kConstruct a range which is scaled relative to the size parameter and uses the full range of a data type.&bounds 0 (linearBounded :: Range Int8)(0,0)'bounds 50 (linearBounded :: Range Int8)(-64,64)'bounds 99 (linearBounded :: Range Int8) (-128,127)+RConstruct a range which scales the second bound relative to the size parameter.This works the same as (, but for fractional values.,IConstruct a range which scales the bounds relative to the size parameter.This works the same as ), but for fractional values.-/Truncate a value so it stays within some range. clamp 5 10 1510 clamp 5 10 05.3Scale an integral linearly with the size parameter./;Scale a fractional number linearly with the size parameter.0`Construct a range which scales the second bound exponentially relative to the size parameter.bounds 0 $ exponential 1 512(1,1)bounds 11 $ exponential 1 512(1,2)bounds 22 $ exponential 1 512(1,4)bounds 77 $ exponential 1 512(1,128)bounds 88 $ exponential 1 512(1,256)bounds 99 $ exponential 1 512(1,512)1XConstruct a range which scales the bounds exponentially relative to the size parameter.'bounds 0 $ exponentialFrom 0 (-128) 512(0,0)(bounds 25 $ exponentialFrom 0 (-128) 512(-2,4)(bounds 50 $ exponentialFrom 0 (-128) 512(-11,22)(bounds 75 $ exponentialFrom 0 (-128) 512 (-39,112)(bounds 99 $ exponentialFrom x (-128) 512 (-128,512)2yConstruct a range which is scaled exponentially relative to the size parameter and uses the full range of a data type.+bounds 0 (exponentialBounded :: Range Int8)(0,0),bounds 50 (exponentialBounded :: Range Int8)(-11,11),bounds 99 (exponentialBounded :: Range Int8) (-128,127)3`Construct a range which scales the second bound exponentially relative to the size parameter.This works the same as 0 , but for floating-point values. bounds 0 $ exponentialFloat 0 10 (0.0,0.0)!bounds 50 $ exponentialFloat 0 10(0.0,2.357035250656098)!bounds 99 $ exponentialFloat 0 10 (0.0,10.0)4ZConstruct a range which scales the bounds exponentially relative to the size parameter.This works the same as 1 , but for floating-point values.*bounds 0 $ exponentialFloatFrom 0 (-10) 20 (0.0,0.0)+bounds 50 $ exponentialFloatFrom 0 (-10) 20'(-2.357035250656098,3.6535836249197002)+bounds 99 $ exponentialFloatFrom x (-10) 20 (-10.0,20.0)58Scale an integral exponentially with the size parameter.6DScale a floating-point number exponentially with the size parameter. !"#$%&'()*+,-./0123456789 !"#$%&'()*+,-./0123456 !"#$%&'()+,*01234-./56 !"#$%&'()*+,-./0123456789NoneI !"#$%&'()*+,01234 !"#$%&'()+,*01234NoneDQRB.Distribute one monad transformer over another.@ABCDEF@AB@AB@ABCDEFNone 9:;<=DORTGAA node in an effectful tree, as well as its unevaluated children.KUAn effectful tree, each node in the tree can have an effect before it is produced.N Create a K from a GO5Create a tree from a value and an unfolding function.P7Create a forest from a value and an unfolding function.Q*Expand a tree using an unfolding function.RThrow away a tree's children.SWRender a tree of strings, note that this forces all the delayed effects in the tree.9GHIJKLMNOPQR   STUVWXYZ[\]^_`abcdefghijklmn GHIJKLMNOPQRS KLMGHIJNOPQRS4GHIJKLMNOPQR   STUVWXYZ[\]^_`abcdefghijklmnNone%&(,/2349:;<=DILORT[[u8Class of monads which can generate input data for tests.CThe functions on this class can, and should, be used without their Gen suffix by importing  Hedgehog.Gen qualified.vSee Gen. wSee Gen. xSee Gen. ySee Gen. zSee Gen. {6Monad transformer which can generate random values of a.~Generator for random values of a.,Runs a generator, producing its shrink tree.#Map over a generator's shrink tree.SLift a predefined shrink tree in to a generator, ignoring the seed and the size.;Run the discard effects through the tree and reify them as   values at the nodes.   means discarded,  means we have a value.Lift a vanilla ~ in to a u.(Generate a value with no shrinks from a  and a .*Apply a shrinking function to a generator.hThis will give the generator additional shrinking options, while keeping the existing shrinks intact.%Throw away a generator's shrink tree.9Construct a generator that depends on the size parameter.tOverride the size parameter. Returns a generator which uses the given size instead of the runtime-size parameter.EAdjust the size parameter by transforming it with the given function.7Make a generator smaller by scaling its size parameter.$Scale a size using the golden ratio. )golden x = x /  golden x = x / 1.61803..0Generates a random integral number in the given [inclusive,inclusive] range.BWhen the generator tries to shrink, it will shrink towards the   of the specified .CFor example, the following generator will produce a number between 1970 and 2100, but will shrink towards 2000: integral (Range.& 2000 1970 2100) :: ~  8Some sample outputs from this generator might look like: ==== Outcome === 1973 === Shrinks === 2000 1987 1980 1976 1974 B=== Outcome === 2061 === Shrinks === 2000 2031 2046 2054 2058 2060FGenerates a random integral number in the [inclusive,inclusive] range.This generator does not shrink.0Generates a random machine integer in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience..Generates a random 8-bit integer in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience./Generates a random 16-bit integer in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience./Generates a random 32-bit integer in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience./Generates a random 64-bit integer in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience.-Generates a random machine word in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience.%Generates a random byte in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience.,Generates a random 16-bit word in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience.,Generates a random 32-bit word in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience.,Generates a random 64-bit word in the given [inclusive,inclusive] range.This is a specialization of , offered for convenience.0Generates a random floating-point number in the [inclusive,exclusive) range.!This generator works the same as !, but for floating point numbers.HGenerates a random fractional number in the [inclusive,exclusive) range.This generator does not shrink.0Generates a random floating-point number in the [inclusive,exclusive) range.This is a specialization of , offered for convenience.0Generates a random floating-point number in the [inclusive,exclusive) range.This is a specialization of , offered for convenience.)Generates an element from an enumeration.2This generator shrinks towards the first argument. For example: enum 'a' 'z' :: ~  4Generates a random value from a bounded enumeration.This generator shrinks towards . For example: enumBounded :: ~  Generates a random boolean.This generator shrinks to .This is a specialization of , offered for convenience.Generates a random boolean.This generator does not shrink.Generates an ASCII binit: '0'..'1'Generates an ASCII octit: '0'..'7'Generates an ASCII digit: '0'..'9'Generates an ASCII hexit: '0'..'9', 'a'..'f', 'A'..'F'%Generates an ASCII lowercase letter: 'a'..'z'%Generates an ASCII uppercase letter: 'A'..'Z'Generates an ASCII letter: 'a'..'z', 'A'..'Z'$Generates an ASCII letter or digit: 'a'..'z', 'A'..'Z', '0'..'9'Generates an ASCII character:  '\0'..'\127'Generates a Latin-1 character:  '\0'..'\255'KGenerates a Unicode character, excluding invalid standalone surrogates: '\0'..'\1114111' (excluding '\55296'..'\57343')KGenerates a Unicode character, including invalid standalone surrogates: '\0'..'\1114111'2Check if a character is in the surrogate category.Generates a string using  to determine the length.This is a specialization of , offered for convenience.Generates a string using  to determine the length.(Generates a UTF-8 encoded string, using  to determine the length.Generates a random , using  to determine the length.8Trivial generator that always produces the same element.This is another name for  / .1Randomly selects one of the elements in the list.=This generator shrinks towards the first element in the list.!The input list must be non-empty.3Randomly selects one of the generators in the list.?This generator shrinks towards the first generator in the list.!The input list must be non-empty.UUses a weighted distribution to randomly select one of the generators in the list.?This generator shrinks towards the first generator in the list.!The input list must be non-empty.BModifies combinators which choose from a list of generators, like  or 2, so that they can be used in recursive scenarios.This combinator modifies its target to select one of the generators in either the non-recursive or the recursive list. When a selection is made from the recursive list, the  is halved. When the l gets to one or less, selections are no longer made from the recursive list, this ensures termination.FA good example of where this might be useful is abstract syntax trees: rdata Expr = Var String | Lam String Expr | App Expr Expr -- Assuming we have a name generator genName :: uG m => m String -- We can write a generator for expressions genExpr :: u m => m Expr genExpr = Gen. Gen./ [ -- non-recursive generators Var 9 genName ] [ -- recursive generators Gen. genExpr (x -> Lam  genName  pure x) , Gen. genExpr genExpr App ] )If we wrote the above example using only U, it is likely that it would fail to terminate. This is because for every call to genExpr9, there is a 2 in 3 chance that we will recurse again.Discards the whole generator.PDiscards the generator if the generated value does not satisfy the predicate.-Generates a value that satisfies a predicate.This is essentially: filter p gen = mfilter p gen  filter p gen It differs from the above in that we keep some state to avoid looping forever. If we trigger these limits then the whole generator is discarded.Runs a   generator until it produces a .This is implemented using  and has the same caveats. Generates a   some of the time.Generates a list using a  to determine the length.Generates a seq using a  to determine the length.#Generates a non-empty list using a  to determine the length.Generates a set using a  to determine the length.;This may fail to generate anything if the element generator >cannot produce a large enough number of unique items to satify the required set size.Generates a map using a  to determine the length.>This may fail to generate anything if the keys produced by the <generator do not account for a large enough number of unique &items to satify the required map size.Generate exactly n unique generators.?Check that list contains at least a certain number of elements.cFreeze the size and seed used by a generator, so we can inspect the value which it will produce.This is used for implementing  and _. It allows us to shrink the list itself before trying to shrink the values inside the list.<Constructs a generator from a number of sub-term generators.,Shrinks to one of the sub-terms if possible.1Constructs a generator from a sub-term generator.$Shrinks to the sub-term if possible.1Constructs a generator from a sub-term generator.$Shrinks to the sub-term if possible.4Constructs a generator from two sub-term generators.,Shrinks to one of the sub-terms if possible.4Constructs a generator from two sub-term generators.,Shrinks to one of the sub-terms if possible.6Constructs a generator from three sub-term generators.,Shrinks to one of the sub-terms if possible.6Constructs a generator from three sub-term generators.,Shrinks to one of the sub-terms if possible.)Generates a random subsequence of a list.)Generates a random permutation of a list.PThis shrinks towards the order of the list being identical to the input list.#Generate a sample from a generator.hPrint the value produced by a generator, and the first level of shrinks, for the given size and seed.Use ( to generate a value from a random seed.NPrint the shrink tree produced by a generator, for the given size and seed.Use ( to generate a value from a random seed.\Run a generator with a random seed and print the outcome, and the first level of shrinks. Gen.print (Gen. 'a' 'f') /=== Outcome === 'd' === Shrinks === 'a' 'b' 'c'GRun a generator with a random seed and print the resulting shrink tree. Gen.printTree (Gen. 'a' 'f')  C'd' %%|'a' %%|'b' % %%|'a' %%|'c' %%|'a' %%|'b' %%|'a'3This may not terminate when the tree is very large.(Render a generator as a tree of strings.opqrstuvwxyz{|}~ !"#$%&'()bopqrtsuvwxyz{|}~b~{|}uvwxyzopqrstopqrstuvwxyz{|}~ !"#$%&'()q5 NoneGGNone @ABuvwxyz{~~{uvwxyz @AB* !"#$%&'()**++,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTTUVWWXYZ[\ ]^_`abcdefghijklmnopqrstuvwxyz{|}~   2      !"#$%&'()*+,-./0123456#savage-1.0.2-Fjapz78YwBu8UKO7XZfC3GSavage.Internal.ShrinkSavageSavage.Internal.Seed Savage.RangeSavage.Internal.RangeSavage.Internal.DistributiveSavage.Internal.TreeSavage.Internal.Gen Savage.Randy Hedgehog.Genliftshrinkprunescalefreezetowards towardsFloatlistremoveshalvesconsNubSeed seedValue seedGammarandomfrom goldenGammasplit nextInt64 nextInt32 nextInteger nextDoublemix64mix32mix64variant13mixGamma$fRandomGenSeed $fReadSeed $fShowSeed$fEqSeed $fOrdSeedRangeSizeunSizeoriginbounds lowerBound upperBound singletonconstant constantFromconstantBoundedlinear linearFrom linearBounded linearFraclinearFracFromclamp scaleLinearscaleLinearFrac exponentialexponentialFromexponentialBoundedexponentialFloatexponentialFloatFromscaleExponentialscaleExponentialFloat$fFunctorRange $fReadSize $fShowSize$fEqSize $fOrdSize $fNumSize $fRealSize $fEnumSize$fIntegralSize Distributive Transformer distribute$fDistributiveReaderT$fDistributiveWriterT$fDistributiveExceptT$fDistributiveMaybeTNode nodeValue nodeChildrenTreerunTreefromNodeunfold unfoldForestexpandrender $fShow1Tree $fShow1Node $fShowTree $fShowNode$fMonadResourceTree$fMonadErroreTree$fMonadWriterwTree$fMonadStatesTree$fMonadReaderrTree$fMonadCatchTree$fMonadThrowTree$fMonadBasebTree $fMonadIOTree$fPrimMonadTree$fDistributiveTree $fMMonadTree$fMFunctorTYPETree$fMFunctorTYPENode$fMonadTransTree$fMonadPlusTree$fAlternativeTree $fMonadTree $fMonadNode$fApplicativeTree$fApplicativeNode $fFunctorTree $fFunctorNodeVecNil:.NatZSMonadGenliftGen shrinkGenpruneGenscaleGen freezeGenGenTunGenGenrunGenTmapGenTliftTreerunDiscardEffectgeneratesizedresizesmallgoldenintegral integral_intint8int16int32int64wordword8word16word32word64 realFloat realFrac_floatdoubleenum enumBoundedboolbool_binitoctitdigithexitlowerupperalphaalphaNumasciilatin1unicode unicodeAll isSurrogatestringtextutf8byteselementchoice frequency recursivediscardensurefilterjustmaybeseqnonEmptysetmapatLeast subtermMVecsubtermMsubterm subtermM2subterm2 subtermM3subterm3 subsequenceshufflesample printWith printTreeWithprint printTree renderNodes$fMonadResourceGenT$fMonadErroreGenT$fMonadWriterwGenT$fMonadStatesGenT$fMonadReaderrGenT$fMonadCatchGenT$fMonadThrowGenT$fMonadBasebGenT $fMonadIOGenT$fPrimMonadGenT$fDistributiveGenT $fMMonadGenT$fMFunctorTYPEGenT$fMonadTransGenT$fMonadPlusGenT$fAlternativeGenT $fMonadGenT$fApplicativeGenT $fFunctorGenT$fMonadGenRWST$fMonadGenRWST0$fMonadGenWriterT$fMonadGenWriterT0$fMonadGenStateT$fMonadGenStateT0$fMonadGenReaderT$fMonadGenExceptT$fMonadGenMaybeT$fMonadGenIdentityT$fMonadGenGenT$fFunctorSubterms$fFoldableSubterms$fTraversableSubterms$fTraversableVec $fFoldableVec $fFunctorVecbaseGHC.IntInt64nextInt32 integer-gmpGHC.Integer.TypeIntegerghc-prim GHC.TypesDoubleglobal embedNode embedTreedistributeNodedistributeTree handleNode handleTree localNode localTree listenNode listenTreepassNodepassTreehandleErrorNodehandleErrorTreerenderTreeLines renderNoderenderForestLinesGHC.BaseMaybeNothingJustIntCharGHC.EnumminBoundBoolFalsebytestring-0.10.8.1Data.ByteString.Internal ByteStringpurereturn Data.Functor<$><*><|> uniqueByKeySubtermsOneAll shrinkMaybe shrinkEithershrink2shrink3 embedMaybeembedGen distributeGen uniqueInsertshrinkSubterms genSubterms fromSubterms