!?*b      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                   Safe, QuickCheckTest if an exception was a ^C;. QuickCheck won't try to shrink an interrupted test case. QuickCheckZA special exception that makes QuickCheck discard the test case. Normally you should use ==>Z, but if for some reason this isn't possible (e.g. you are deep inside a generator), use  instead. Trustworthy/? QuickCheckLThe "standard" QuickCheck random number generator. A wrapper around either  on GHC, or   on other Haskell systems.   SafeQV\ QuickCheckA generator for values of type a.The third-party package  2http://hackage.haskell.org/package/QuickCheck-GenTQuickCheck-GenT* provides a monad transformer version of GenT. QuickCheckdRun the generator on a particular seed. If you just want to get a random value out, consider using &. QuickCheck+Modifies a generator using an integer seed.  QuickCheck?Used to construct generators that depend on the size parameter. For example, 2m, which uses the size parameter as an upper bound on length of lists it generates, can be defined like this: `listOf :: Gen a -> Gen [a] listOf gen = sized $ \n -> do k <- choose (0,n) vectorOf k genYou can also do this using !.! QuickCheck^Generates the size parameter. Used to construct generators that depend on the size parameter. For example, 2m, which uses the size parameter as an upper bound on length of lists it generates, can be defined like this: ^listOf :: Gen a -> Gen [a] listOf gen = do n <- getSize k <- choose (0,n) vectorOf k genYou can also do this using  ." QuickChecksOverrides the size parameter. Returns a generator which uses the given size instead of the runtime-size parameter.# QuickCheckGAdjust the size parameter, by transforming it with the given function.$ QuickCheck8Generates a random element in the given inclusive range.% QuickCheck5Generates a random element over the natural range of a.& QuickCheckyRun a generator. The size passed to the generator is always 30; if you want another size then you should explicitly use ".' QuickCheckGenerates some example values.( QuickCheck1Generates some example values and prints them to stdout.) QuickCheck-Generates a value that satisfies a predicate.* QuickCheck9Generates a value for which the given function returns a  !, and then applies the function.+ QuickCheckkTries to generate a value that satisfies a predicate. If it fails to do so after enough attempts, returns Nothing., QuickCheckMRandomly uses one of the given generators. The input list must be non-empty.- QuickChecklChooses one of the given generators, with a weighted random distribution. The input list must be non-empty.. QuickCheckDGenerates one of the given values. The input list must be non-empty./ QuickCheck1Generates a random subsequence of the given list.0 QuickCheck1Generates a random permutation of the given list.1 QuickCheckTakes a list of elements of increasing size, and chooses among an initial segment of the list. The size of this initial segment increases with the size parameter. The input list must be non-empty.2 QuickCheckUGenerates a list of random length. The maximum length depends on the size parameter.3 QuickCheck_Generates a non-empty list of random length. The maximum length depends on the size parameter.4 QuickCheck%Generates a list of the given length.5 QuickCheckGenerates an infinite list. !"#$%&'()*+,-./012345 !"#$%&'()*+,-./012345SafeQVgP; QuickCheck>Promotes a monadic generator to a generator of monadic values.< QuickCheck&Randomly generates a function of type  a -> aQ, which you can then use to evaluate generators. Mostly useful in implementing ;.= QuickCheck A variant of <q that returns a polymorphic evaluation function. Can be used in a pinch to generate polymorphic (rank-2) values: genSelector :: Gen (a -> a -> a) genSelector = elements [\x y -> x, \x y -> y] data Selector = Selector (forall a. a -> a -> a) genPolySelector :: Gen Selector genPolySelector = do Capture eval <- capture return (Selector (eval genSelector))9:;<=;<=9: Trustworthy,7;<=>?FKSTV])> QuickCheck(Used for random generation of functions.AIf you are using a recent GHC, there is a default definition of ? using c, so if your type has a   instance it's enough to say instance CoArbitrary MyTypeYou should only use c/ for data types where equality is structural, i.e. if you can't have two different representations of the same value. An example where it's not safe is sets implemented using binary search trees: the same set can be represented as several different trees. Here you would have to explicitly define &coarbitrary s = coarbitrary (toList s).? QuickCheck$Used to generate a function of type a -> bJ. The first argument is a value, the second a generator. You should use } to perturb the random generator; the goal is that different values for the first argument will lead to different calls to . An example will help: Ginstance CoArbitrary a => CoArbitrary [a] where coarbitrary [] =  0 coarbitrary (x:xs) =  1 . coarbitrary (x,xs)   QuickCheckXProvides the immediate subterms of a term that are of the same type as the term itself.In contrast to  9, this returns the immediate next constructor available.  QuickCheckXProvides the immediate subterms of a term that are of the same type as the term itself.HRequires a constructor to be stripped off; this means it skips through M1 wrappers and returns []- on everything that's not `(:*:)` or `(:+:)`.TOnce a `(:*:)` or `(:+:)` constructor has been reached, this function delegates to  7 to return the immediately next constructor available.@ QuickCheckLifting of the F# class to binary type constructors.C QuickCheckLifting of the F" class to unary type constructors.F QuickCheck*Random generation and shrinking of values.QuickCheck provides  Arbitrary instances for most types in baseF, except those which incur extra dependencies. For a wider range of  Arbitrary instances see the  7http://hackage.haskell.org/package/quickcheck-instancesquickcheck-instances package.G QuickCheck)A generator for values of the given type.It is worth spending time thinking about what sort of test data you want - good generators are often the difference between finding bugs and not finding them. You can use (, label and classify( to check the quality of your test data.There is no generic  arbitraryu implementation included because we don't know how to make a high-quality one. If you want one, consider using the  /http://hackage.haskell.org/package/testing-feat testing-feat or  1http://hackage.haskell.org/package/generic-randomgeneric-random packages.The  7http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.htmlQuickCheck manuals goes into detail on how to write good generators. Make sure to look at it, especially if your type is recursive!H QuickCheck[Produces a (possibly) empty list of all the possible immediate shrinks of the given value.The default implementation returns the empty list, so will not try to shrink the value. If your data type has no special invariants, you can enable shrinking by defining  shrink = M', but by customising the behaviour of shrink+ you can often get simpler counterexamples.Most implementations of H" should try at least three things: @Shrink a term to any of its immediate subterms. You can use O to do this.Recursively apply H, to all immediate subterms. You can use N to do this.VType-specific shrinkings such as replacing a constructor by a simpler constructor.JFor example, suppose we have the following implementation of binary trees: .data Tree a = Nil | Branch a (Tree a) (Tree a)We can then define H as follows: shrink Nil = [] shrink (Branch x l r) = -- shrink Branch to Nil [Nil] ++ -- shrink to subterms [l, r] ++ -- recursively shrink subterms [Branch x' l' r' | (x', l', r') <- shrink (x, l, r)]&There are a couple of subtleties here:QuickCheck tries the shrinking candidates in the order they appear in the list, so we put more aggressive shrinking steps (such as replacing the whole tree by NilF) before smaller ones (such as recursively shrinking the subtrees).,It is tempting to write the last line as B[Branch x' l' r' | x' <- shrink x, l' <- shrink l, r' <- shrink r] but this is the  wrong thing(! It will force QuickCheck to shrink x, l and r) in tandem, and shrinking will stop once one! of the three is fully shrunk.~There is a fair bit of boilerplate in the code above. We can avoid it with the help of some generic functions. The function M~ tries shrinking a term to all of its subterms and, failing that, recursively shrinks the subterms. Using it, we can define H as: sshrink x = shrinkToNil x ++ genericShrink x where shrinkToNil Nil = [] shrinkToNil (Branch _ l r) = [Nil]M is a combination of O4, which shrinks a term to any of its subterms, and Nq, which shrinks all subterms of a term. These may be useful if you need a bit more control over shrinking than M gives you.!A final gotcha: we cannot define H as simply H x = Nil:M x as this shrinks Nil to Nil/, and shrinking will go into an infinite loop.1If all this leaves you bewildered, you might try H = M to begin with, after deriving Genericd for your type. However, if your data type has any special invariants, you will need to check that M can't break those invariants.M QuickCheckZShrink a term to any of its immediate subterms, and also recursively shrink all subterms.N QuickCheck*Recursively shrink all immediate subterms.O QuickCheck!All immediate subterms of a term.P QuickCheckIShrink a list of values given a shrinking function for individual values.Q QuickCheck,Apply a binary function to random arguments.R QuickCheck-Apply a ternary function to random arguments.S QuickCheck0Apply a function of arity 4 to random arguments.T QuickCheckGenerates an integral number. The number can be positive or negative and its maximum absolute value depends on the size parameter.U QuickCheckVGenerates a natural number. The number's maximum value depends on the size parameter.V QuickCheckGenerates a fractional number. The number can be positive or negative and its maximum absolute value depends on the size parameter.W QuickCheckvGenerates an integral number. The number is chosen uniformly from the entire range of the type. You may want to use Z instead.X QuickCheckaGenerates an element of a bounded type. The element is chosen from the entire range of the type.Y QuickCheck.Generates an element of a bounded enumeration.Z QuickCheckGenerates an integral number from a bounded domain. The number is chosen from the entire range of the type, but small numbers are generated more often than big numbers. Inspired by demands from Phil Wadler.[ QuickCheck5Generates any Unicode character (but not a surrogate)\ QuickCheck+Generates a random ASCII character (0-127).] QuickCheck(Generates a printable Unicode character.^ QuickCheck"Returns no shrinking alternatives._ QuickCheckiMap a shrink function to another domain. This is handy if your data type has special invariants, but is almost isomorphic to some other type. shrinkOrderedList :: (Ord a, Arbitrary a) => [a] -> [[a]] shrinkOrderedList = shrinkMap sort id shrinkSet :: (Ord a, Arbitrary a) => Set a -> Set [a] shrinkSet = shrinkMap fromList toList ` QuickCheckNon-overloaded version of _.a QuickCheckShrink an integral number.b QuickCheckShrink a fraction.c QuickCheck#Generic CoArbitrary implementation.d QuickCheckQCombine two generator perturbing functions, for example the results of calls to  or ?.e QuickCheckA ?% implementation for integral numbers.f QuickCheckA ?! implementation for real numbers.g QuickCheck? helper for lazy people :-).h QuickCheckA ? implementation for enums.i QuickCheck#Generates a list of a given length.j QuickCheckGenerates an ordered list.k QuickCheckGenerates an infinite list.n QuickCheck Generates  with non-empty non-negative  versionBranch , and empty  versionTags.>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk.FGH>?CDEIJ@ABKLQRSTUWZVXY[\]MONc^P_`abefghdijkSafe !"#$%&'()*+,-./012012-./*+,'()$%&!"# Trustworthy1>?KQ QuickCheckPrintableStringU: generates a printable unicode String. The string will not contain surrogate pairs.T QuickCheck UnicodeStringK: generates a unicode String. The string will not contain surrogate pairs.W QuickCheck ASCIIString: generates an ASCII string.] QuickCheck Shrinking _ x2: allows for maintaining a state during shrinking._ QuickCheck Smart _ x): tries a different order when shrinking.a QuickCheck Shrink2 x<: allows 2 shrinking steps at the same time when shrinking xd QuickCheckSmall x: generates values of x, drawn from a small range. The opposite of g.g QuickCheckLarge x#: by default, QuickCheck generates s drawn from a small range.  Large Int6 gives you values drawn from the entire range instead.j QuickCheck NonNegative x: guarantees that x >= 0.m QuickCheck NonZero x: guarantees that x /= 0.p QuickCheck Positive x: guarantees that x > 0.s QuickCheckInfiniteList xs _: guarantees that xs is an infinite list. When a counterexample is found, only prints the prefix of xs that was used by the program.%Here is a contrived example property: pprop_take_10 :: InfiniteList Char -> Bool prop_take_10 (InfiniteList xs _) = or [ x == 'a' | x <- take 10 xs ]:In the following counterexample, the list must start with  "bbbbbbbbbb"9 but the remaining (infinite) part can contain anything:quickCheck prop_take_106*** Failed! Falsifiable (after 1 test and 14 shrinks):"bbbbbbbbbb" ++ ...w QuickCheck NonEmpty xs": guarantees that xs is non-empty.z QuickCheck Ordered xs : guarantees that xs is ordered.} QuickCheckFixed x: as x, but will not be shrunk. QuickCheckBlind x): as x, but x does not have to be in the  class.2QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2}~z{|wxystuvpqrmnojklghidef_`abc]^Z[\WXYTUVQRSSafe %&',7<FSTe" QuickCheck4Generation of random shrinkable, showable functions."To generate random values of type  a b, you must have an instance  a. See also , and  with GHC >= 7.8. QuickCheck The class  Function a> is used for random generation of showable functions of type a -> b.&There is a default implementation for \, which you can use if your type has structural equality. Otherwise, you can normally use  or . QuickCheck/The type of possibly partial concrete functions QuickCheck)A modifier for testing ternary functions. QuickCheck(A modifier for testing binary functions. prop_zipWith :: Fun (Int, Bool) Char -> [Int] -> [Bool] -> Bool prop_zipWith (Fn2 f) xs ys = zipWith f xs ys == [ f x y | (x, y) <- zip xs ys] QuickCheck!A modifier for testing functions. rprop :: Fun String Integer -> Bool prop (Fn f) = f "banana" == f "monkey" || f "banana" == f "elephant" QuickCheck Provides a  instance for types with  and C. Use only for small types (i.e. not integers): creates the list ['minBound'..'maxBound']! QuickCheck Provides a  instance for types with . QuickCheck Provides a  instance for types with . QuickCheck Provides a  instance for types with  and . QuickCheckThe basic building block for  instances. Provides a < instance by mapping to and from a type that already has a  instance. QuickCheckGeneric  implementation. QuickCheck Alias to . QuickCheck!Extracts the value of a function., is the pattern equivalent of this function. prop :: Fun String Integer -> Bool prop f = applyFun f "banana" == applyFun f "monkey" || applyFun f "banana" == applyFun f "elephant" QuickCheck(Extracts the value of a binary function., is the pattern equivalent of this function. prop_zipWith :: Fun (Int, Bool) Char -> [Int] -> [Bool] -> Bool prop_zipWith f xs ys = zipWith (applyFun2 f) xs ys == [ applyFun2 f x y | (x, y) <- zip xs ys] QuickCheck*Extracts the value of a ternary function. - is the pattern equivalent of this function. Safe#3456789:;<=>?@ABCD456789:;<=>?@A3DBC Safe3F QuickCheckxState represents QuickCheck's internal state while testing a property. The state is made visible to callback functions.H QuickCheckthe current terminalI QuickCheck)maximum number of successful tests neededJ QuickCheck5maximum number of discarded tests per successful testK QuickCheck.how to compute the size of test cases from  tests and discarded testsL QuickCheck(How many shrinks to try before giving upM QuickCheck/the current number of tests that have succeededN QuickCheck%the current number of discarded testsO QuickCheck<the number of discarded tests since the last successful testP QuickCheck(all labels that have been defined so farQ QuickCheck*all labels that have been collected so farR QuickCheck-indicates if the property is expected to failS QuickCheckthe current random seedT QuickCheck+number of successful shrinking steps so farU QuickCheckAnumber of failed shrinking steps since the last successful shrinkV QuickCheck&total number of failed shrinking stepsFGVUTSRQONMLKJIHPFGVUTSRQONMLKJIHP Safe16W QuickCheckThe result of a single test.Y QuickCheck*result of the test case; Nothing = discardZ QuickCheck5indicates what the expected result of the property is[ QuickCheck$a message indicating what went wrong\ QuickCheckthe exception thrown, if any] QuickCheck(if True, the test should not be repeated^ QuickCheckstop after this many tests_ QuickCheck all labels used by this property` QuickCheck'the collected labels for this test casea QuickCheck the callbacks for this test caseb QuickCheckthe generated test cased QuickCheckAffected by the  combinatore QuickCheckNot affected by the  combinatorf QuickCheckDifferent kinds of callbacksg QuickCheckCalled just after a testh QuickCheck'Called with the final failing test-caseo QuickCheckIf a property returns oO, the current test case is discarded, the same as if a precondition was false.q QuickCheck|The class of properties, i.e., types which QuickCheck knows how to test. Typically a property will be a function returning  or s.NIf a property does no quantification, i.e. has no parameters and doesn't use U, it will only be tested once. This may not be what you want if your property is an IO Bool+. You can change this behaviour using the  combinator.r QuickCheck Convert the thing to a property.s QuickCheckThe type of properties.v QuickCheckDo I/O inside a property.w QuickCheckDo I/O inside a property.?Warning: any random values generated inside of the argument to  ioProperty] will not currently be shrunk. For best results, generate all random values before calling  ioProperty.{ QuickCheck Execute the IORose> bits of a rose tree, returning a tree constructed by MkRose.| QuickCheckaApply a function to the outermost MkRose constructor of a rose tree. The function must be total!} QuickCheck)Wrap a rose tree in an exception handler.~ QuickCheck:Wrap all the Results in a rose tree in exception handlers. QuickCheck2Changes the maximum test case size for a property. QuickCheckShrinks the argument to a property if it fails. Shrinking is done automatically for most types. This function is only needed when you want to override the default behavior. QuickCheck-Disables shrinking for a property altogether. QuickCheckAdds a callback QuickCheckBAdds the given string to the counterexample if the property fails. QuickCheckBAdds the given string to the counterexample if the property fails. QuickCheck Performs an - action after the last failure of a property. QuickCheck Performs an  action every time a property fails. Thus, if shrinking is done, this can be used to keep track of the failures along the way. QuickCheckePrints out the generated testcase every time the property is tested. Only variables quantified over inside the  are printed. QuickCheckdIndicates that a property is supposed to fail. QuickCheck will report an error if it does not fail. QuickCheckFModifies a property so that it only will be tested once. Opposite of . QuickCheckGModifies a property so that it will be tested repeatedly. Opposite of . QuickCheck4Configures how many times a property will be tested. For example, "quickCheck (withMaxSuccess 1000 p) will test p up to 1000 times. QuickCheckSAttaches a label to a property. This is used for reporting test case distribution. For example: prop_reverse_reverse :: [Int] -> Property prop_reverse_reverse xs = label ("length of input is " ++ show (length xs)) $ reverse (reverse xs) === xsquickCheck prop_reverse_reverse+++ OK, passed 100 tests:7% length of input is 76% length of input is 35% length of input is 44% length of input is 6... QuickCheckSAttaches a label to a property. This is used for reporting test case distribution. collect x = label (show x) For example: {prop_reverse_reverse :: [Int] -> Property prop_reverse_reverse xs = collect (length xs) $ reverse (reverse xs) === xsquickCheck prop_reverse_reverse+++ OK, passed 100 tests:7% 76% 35% 44% 6... QuickCheck6Records how many test cases satisfy a given condition. For example: prop_sorted_sort :: [Int] -> Property prop_sorted_sort xs = sorted xs ==> classify (length xs > 1) "non-trivial" $ sort xs === xsquickCheck prop_sorted_sort++++ OK, passed 100 tests (22% non-trivial). QuickCheck-Checks that at least the given proportion of  successfulv test cases belong to the given class. Discarded tests (i.e. ones with a false precondition) do not affect coverage. For example: prop_sorted_sort :: [Int] -> Property prop_sorted_sort xs = sorted xs ==> cover (length xs > 1) 50 "non-trivial" $ sort xs === xsquickCheck prop_sorted_sortJ*** Insufficient coverage after 100 tests (only 24% non-trivial, not 50%). QuickCheckSImplication for properties: The resulting property holds if the first argument is M (in which case the test case is discarded), or if the given property holds. QuickCheck]Considers a property failed if it does not complete within the given number of microseconds. QuickCheckQExplicit universal quantification: uses an explicitly given test case generator. QuickCheckLike :, but tries to shrink the argument for failing test cases. QuickCheckNondeterministic choice: p1  p2 picks randomly one of p1 and p2J to test. If you test the property 100 times it makes 100 random choices. QuickCheck Conjunction: p1  p2 passes if both p1 and p2 pass. QuickCheck+Take the conjunction of several properties. QuickCheck Disjunction: p1  p2 passes unless p1 and p2 simultaneously fail. QuickCheck+Take the disjunction of several properties. QuickCheckLike ,, but prints a counterexample when it fails. QuickCheckAChecks that a value is total, i.e., doesn't crash when evaluated. QuickCheckH-like function. QuickCheckThe original argument QuickCheckTrue% if the test case should be labelled. QuickCheckLabel. QuickCheckTrue' if the test case belongs to the class. QuickCheck.The required percentage (0-100) of test cases. QuickCheckLabel for the test case class.PWXba^]Y`\[_Zcedfhgikjlmnopqrstuvwxyz{|}~Pstuqropvwxlmnikjyz{|}~fhgcedWXba^]Y`\[_Z01114 Safed" QuickCheck!Result represents the test result QuickCheckA successful test run QuickCheckGiven up QuickCheckA failed test run QuickCheck*A property that should have failed did not QuickCheckThe tests passed but a use of  had insufficient coverage QuickCheckNumber of tests performed QuickCheck8Labels and frequencies found during all successful tests QuickCheckPrinted output QuickCheck.Number of successful shrinking steps performed QuickCheck0Number of unsuccessful shrinking steps performed QuickCheckMNumber of unsuccessful shrinking steps performed since last successful shrink QuickCheckWhat seed was used QuickCheckWhat was the test size QuickCheckWhy did the property fail QuickCheck(The exception the property threw, if any QuickCheck(The test case which provoked the failure QuickCheck1Args specifies arguments to the QuickCheck driver QuickCheckShould we replay a previous test? Note: saving a seed from one version of QuickCheck and replaying it in another is not supported. If you want to store a test case permanently you should save the test case itself. QuickCheckMaximum number of successful tests before succeeding. Testing stops at the first failure. If all tests are passing and you want to run more tests, increase this number. QuickCheckFMaximum number of discarded tests per successful test before giving up QuickCheck&Size to use for the biggest test cases QuickCheckWhether to print anything QuickCheck[Maximum number of shrinks to before giving up. Setting this to zero turns shrinking off. QuickCheck*Check if the test run result was a success QuickCheckThe default test arguments QuickCheck+Tests a property and prints the results to stdout.lBy default up to 100 tests are performed, which may not be enough to find all bugs. To run more tests, use . QuickCheckBTests a property, using test arguments, and prints the results to stdout. QuickCheckDTests a property, produces a test result, and prints the results to stdout. QuickCheckZTests a property, using test arguments, produces a test result, and prints the results to stdout. QuickCheckHTests a property and prints the results and all test cases generated to stdout>. This is just a convenience function that means the same as  . . QuickCheck_Tests a property, using test arguments, and prints the results and all test cases generated to stdout5. This is just a convenience function that combines  and . QuickCheckaTests a property, produces a test result, and prints the results and all test cases generated to stdout5. This is just a convenience function that combines  and . QuickCheckwTests a property, using test arguments, produces a test result, and prints the results and all test cases generated to stdout5. This is just a convenience function that combines  and .66 SafeQV  QuickCheckeThe property monad is really a monad transformer that can contain monadic computations in the monad m it is parameterized by:m - the m+-computations that may be performed within  PropertyM Elements of  PropertyM m a! may mix property operations and m-computations. QuickCheck:Allows embedding non-monadic properties into monadic ones. QuickCheckTests preconditions. Unlike p this does not cause the property to fail, rather it discards them just like using the implication combinator .This allows representing the )https://en.wikipedia.org/wiki/Hoare_logic Hoare triple  {p} x ! e{q}as pre p x <- run e assert q  QuickCheckGThe lifting operation of the property monad. Allows embedding monadic/-actions in properties: Hlog :: Int -> IO () prop_foo n = monadicIO $ do run (log n) -- ...  QuickCheck8Quantification in a monadic property, fits better with  do-notation than . QuickCheckThe Shttps://en.wikipedia.org/wiki/Predicate_transformer_semantics#Weakest_preconditionsweakest precondition  wp(x ! e, p)can be expressed as in code as wp e (\x -> p). QuickCheck9An alternative to quantification a monadic properties to , with a notation similar to . QuickCheck/Allows making observations about the test data:  monitor ( e) &collects the distribution of value of e.  monitor ( "Failure!") Adds  "Failure!" to the counterexamples. QuickCheckRuns the property monad for -computations. >prop_cat msg = monadicIO $ do (exitCode, stdout, _) <- run ( "cat" [] msg) pre (( == exitCode) assert (stdout == msg) quickCheck prop_cat+++ OK, passed 100 tests. QuickCheckRuns the property monad for -computations. A-- Your mutable sorting algorithm here sortST :: Ord a => [a] ->  s (MVector s a) sortST =  .  . 4 prop_sortST xs = monadicST $ do sorted <- run ( =<< sortST xs) assert ( sorted == sort xs) quickCheck prop_sortST+++ OK, passed 100 tests. TrustworthyQV x QuickCheck>Test a polymorphic property, defaulting all type variables to . Invoke as $( 'prop), where prop+ is a property. Note that just evaluating  propM in GHCi will seem to work, but will silently default all type variables to ()!$( 'prop) means the same as  $( 'prop)-. If you want to supply custom arguments to , you will have to combine  and  yourself.If you want to use Z in the same file where you defined the property, the same scoping problems pop up as in : see the note there about  return []. QuickCheck>Test a polymorphic property, defaulting all type variables to 5. This is just a convenience function that combines  and .If you want to use Z in the same file where you defined the property, the same scoping problems pop up as in : see the note there about  return []. QuickCheckGMonomorphise an arbitrary property by defaulting all type variables to .For example, if f has type  a => [a] -> [a] then $( 'f) has type [] -> [].If you want to use Z in the same file where you defined the property, the same scoping problems pop up as in : see the note there about  return []. QuickCheck;Test all properties in the current module, using a custom $ function. The same caveats as with  apply.$ has type (s ->  ) ->  . An example invocation is $  , which does the same thing as $.$ has the same issue with scoping as : see the note there about  return []. QuickCheck*List all properties in the current module.$ has type [(, s)].$ has the same issue with scoping as : see the note there about  return []. QuickCheckUTest all properties in the current module. The name of the property must begin with prop_/. Polymorphic properties will be defaulted to  . Returns  if all tests succeeded,  otherwise.To use 5, add a definition to your module along the lines of #return [] runTests = $quickCheckAlland then execute runTests.Note: the bizarre  return []C in the example above is needed on GHC 7.8 and later; without it, G will not be able to find any of the properties. For the curious, the  return [] is a Template Haskell splice that makes GHC insert the empty list of declarations at that point in the program; GHC typechecks everything before the  return []Q before it starts on the rest of the module, which means that the later call to 1 can see everything that was defined before the  return []. Yikes! QuickCheck^Test all properties in the current module. This is just a convenience function that combines  and .$ has the same issue with scoping as : see the note there about  return [].Safee  !"#$&'()*+,-./012345>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~opqrsw$,-.1 !"#)*+23450/ijk&('FGH>?CDEIJ@ABKLQRSTUVZWXY[\]cMON^P_`abefghd}~z{|wxystuvpqrmnojklghidef_`abc]^Z[\WXYTUVQRSsqrwop  !"##$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789::;<<=>>?@@ABBCDDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcddeffghhijklmmnnoopqqrsstuuvwwxyyz{{|}~      !"#$%&'()*+,-./012345 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a S b c d e f g h i j k l m n o p q q r s t u v w x y z { | } ~                                                     Z       S       ^ _                                             *                                !"#$ %&'()#*  +,-(QuickCheck-2.11.3-58QsvdIMmwDDNaUIIDmLArTest.QuickCheck.ExceptionTest.QuickCheck.RandomTest.QuickCheck.GenTest.QuickCheck.Gen.UnsafeTest.QuickCheck.ArbitraryTest.QuickCheck.PolyTest.QuickCheck.ModifiersTest.QuickCheck.FunctionTest.QuickCheck.TextTest.QuickCheck.StateTest.QuickCheck.PropertyTest.QuickCheck.TestTest.QuickCheck.MonadicTest.QuickCheck.AllSystem.ProcessreadProcessWithExitCode System.Exit ExitSuccess Data.VectorthawfromList Data.ListsortfreezetoListTest.QuickCheck AnException tryEvaluate tryEvaluateIOevaluate isInterruptdiscard isDiscardfinallyQCGen newTheGenbitsmaskdoneBitchipchopstopmkTheGennewQCGenmkQCGen bigNatVariant natVariant variantTheGen boolVariant variantQCGen$fRandomGenQCGen $fReadQCGen $fShowQCGenGenMkGenunGenvariantsizedgetSizeresizescalechoose chooseAnygeneratesample'samplesuchThat suchThatMap suchThatMaybeoneof frequencyelements sublistOfshufflegrowingElementslistOflistOf1vectorOfinfiniteListOf $fMonadGen$fApplicativeGen $fFunctorGenCapturepromotedelaycapture CoArbitrary coarbitrary Arbitrary2liftArbitrary2 liftShrink2 Arbitrary1 liftArbitrary liftShrink Arbitrary arbitraryshrink arbitrary1shrink1 arbitrary2shrink2 genericShrinkrecursivelyShrinksubterms shrinkListapplyArbitrary2applyArbitrary3applyArbitrary4arbitrarySizedIntegralarbitrarySizedNaturalarbitrarySizedFractionalarbitraryBoundedIntegralarbitraryBoundedRandomarbitraryBoundedEnumarbitrarySizedBoundedIntegralarbitraryUnicodeChararbitraryASCIIChararbitraryPrintableChar shrinkNothing shrinkMap shrinkMapByshrinkIntegralshrinkRealFracgenericCoarbitrary><coarbitraryIntegralcoarbitraryRealcoarbitraryShowcoarbitraryEnumvector orderedList infiniteList$fArbitraryExitCode$fArbitraryQCGen$fArbitraryVersion$fArbitraryAlt$fArbitraryLast$fArbitraryFirst$fArbitraryProduct$fArbitrarySum$fArbitraryAny$fArbitraryAll$fArbitraryDual$fArbitraryWrappedArrow$fArbitraryWrappedMonad$fArbitraryConst$fArbitraryConstant$fArbitraryIdentity$fArbitraryZipList$fArbitrarySeq$fArbitraryIntMap$fArbitraryIntSet$fArbitraryMap$fArbitrarySet$fArbitraryCDouble$fArbitraryCFloat$fArbitraryCUIntMax$fArbitraryCIntMax$fArbitraryCUIntPtr$fArbitraryCIntPtr$fArbitraryCULLong$fArbitraryCLLong$fArbitraryCSigAtomic$fArbitraryCWchar$fArbitraryCSize$fArbitraryCPtrdiff$fArbitraryCULong$fArbitraryCLong$fArbitraryCUInt$fArbitraryCInt$fArbitraryCUShort$fArbitraryCShort$fArbitraryCUChar$fArbitraryCSChar$fArbitraryCChar$fArbitraryDouble$fArbitraryFloat$fArbitraryChar$fArbitraryWord64$fArbitraryWord32$fArbitraryWord16$fArbitraryWord8$fArbitraryWord$fArbitraryInt64$fArbitraryInt32$fArbitraryInt16$fArbitraryInt8$fArbitraryInt$fArbitraryInteger$fArbitrary(,,,,,,,,,)$fArbitrary(,,,,,,,,)$fArbitrary(,,,,,,,)$fArbitrary(,,,,,,)$fArbitrary(,,,,,)$fArbitrary(,,,,)$fArbitrary(,,,)$fArbitrary(,,)$fArbitrary(,)$fArbitraryFixed$fArbitraryComplex$fArbitraryRatio $fArbitrary[]$fArbitraryEither$fArbitraryMaybe$fArbitraryOrdering$fArbitraryBool $fArbitrary()$fArbitraryCompose$fArbitrary1Compose$fArbitraryProduct0$fArbitrary1Product$fArbitrary1Identity$fArbitrary1ZipList$fArbitrary1Seq$fArbitrary1IntMap$fArbitrary1Map$fArbitrary1[]$fArbitrary1Maybe$fArbitrary1Const$fArbitrary2Const$fArbitrary1Constant$fArbitrary2Constant$fArbitrary1(,)$fArbitrary2(,)$fArbitrary1Either$fArbitrary2Either$fRecursivelyShrinkkV1$fRecursivelyShrinkkU1$fRecursivelyShrinkkK1$fRecursivelyShrinkkM1$fRecursivelyShrinkk:+:$fRecursivelyShrinkk:*:$fGSubtermsK1b$fGSubtermsM1a$fGSubtermsU1a$fGSubtermsV1a$fGSubtermsInclK1b$fGSubtermsInclK1a$fGSubtermsInclM1a$fGSubtermsIncl:+:a$fGSubtermsIncl:*:a$fGSubtermsInclU1a$fGSubtermsInclV1a$fGSubterms:+:a$fGSubterms:*:a$fArbitraryBounds$fIntegralBounds$fBoundedBounds$fArbitraryCSUSeconds$fArbitraryCUSeconds$fArbitraryCTime$fArbitraryCClock$fGCoArbitrarykM1$fGCoArbitraryk:+:$fGCoArbitraryk:*:$fGCoArbitrarykU1$fCoArbitraryVersion$fCoArbitraryAlt$fCoArbitraryLast$fCoArbitraryFirst$fCoArbitraryProduct$fCoArbitrarySum$fCoArbitraryAny$fCoArbitraryAll$fCoArbitraryEndo$fCoArbitraryDual$fCoArbitraryConst$fCoArbitraryConstant$fCoArbitraryIdentity$fCoArbitraryZipList$fCoArbitrarySeq$fCoArbitraryIntMap$fCoArbitraryIntSet$fCoArbitraryMap$fCoArbitrarySet$fCoArbitraryDouble$fCoArbitraryFloat$fCoArbitraryChar$fCoArbitraryWord64$fCoArbitraryWord32$fCoArbitraryWord16$fCoArbitraryWord8$fCoArbitraryWord$fCoArbitraryInt64$fCoArbitraryInt32$fCoArbitraryInt16$fCoArbitraryInt8$fCoArbitraryInt$fCoArbitraryInteger$fCoArbitrary(,,,,)$fCoArbitrary(,,,)$fCoArbitrary(,,)$fCoArbitrary(,)$fCoArbitraryComplex$fCoArbitraryFixed$fCoArbitraryRatio$fCoArbitrary[]$fCoArbitraryEither$fCoArbitraryMaybe$fCoArbitraryOrdering$fCoArbitraryBool$fCoArbitrary()$fCoArbitrary(->)$fGCoArbitrarykK1$fArbitraryEndo$fArbitrary(->)$fArbitrary1(->) $fEqBounds $fOrdBounds $fNumBounds $fEnumBounds $fRealBounds $fShowBoundsOrdCunOrdCOrdBunOrdBOrdAunOrdACunCBunBAunA$fCoArbitraryA $fArbitraryA$fShowA$fCoArbitraryB $fArbitraryB$fShowB$fCoArbitraryC $fArbitraryC$fShowC$fCoArbitraryOrdA$fArbitraryOrdA $fShowOrdA $fNumOrdA$fCoArbitraryOrdB$fArbitraryOrdB $fShowOrdB $fNumOrdB$fCoArbitraryOrdC$fArbitraryOrdC $fShowOrdC $fNumOrdC$fEqA$fEqB$fEqC$fEqOrdA $fOrdOrdA$fEqOrdB $fOrdOrdB$fEqOrdC $fOrdOrdCPrintableStringgetPrintableString UnicodeStringgetUnicodeString ASCIIStringgetASCIIString ShrinkState shrinkInit shrinkState ShrinkingSmartShrink2 getShrink2SmallgetSmallLargegetLarge NonNegativegetNonNegativeNonZero getNonZeroPositive getPositive InfiniteListgetInfiniteListinfiniteListInternalData NonEmptyListNonEmpty getNonEmpty OrderedListOrdered getOrderedFixedgetFixedBlindgetBlind$fArbitraryBlind $fShowBlind$fFunctorBlind$fFunctorFixed$fArbitraryOrderedList$fFunctorOrderedList$fArbitraryNonEmptyList$fFunctorNonEmptyList#$fArbitraryInfiniteListInternalData$fArbitraryInfiniteList$fShowInfiniteList$fArbitraryPositive$fFunctorPositive$fArbitraryNonZero$fFunctorNonZero$fArbitraryNonNegative$fFunctorNonNegative$fArbitraryLarge$fFunctorLarge$fArbitrarySmall$fFunctorSmall$fArbitraryShrink2$fFunctorShrink2$fArbitrarySmart $fShowSmart$fFunctorSmart$fShowShrinking$fFunctorShrinking$fArbitraryShrinking$fArbitraryASCIIString$fArbitraryUnicodeString$fArbitraryPrintableString $fEqBlind $fOrdBlind $fNumBlind$fIntegralBlind $fRealBlind $fEnumBlind $fEqFixed $fOrdFixed $fShowFixed $fReadFixed $fNumFixed$fIntegralFixed $fRealFixed $fEnumFixed$fEqOrderedList$fOrdOrderedList$fShowOrderedList$fReadOrderedList$fEqNonEmptyList$fOrdNonEmptyList$fShowNonEmptyList$fReadNonEmptyList $fEqPositive $fOrdPositive$fShowPositive$fReadPositive$fEnumPositive $fEqNonZero $fOrdNonZero $fShowNonZero $fReadNonZero $fEnumNonZero$fEqNonNegative$fOrdNonNegative$fShowNonNegative$fReadNonNegative$fEnumNonNegative $fEqLarge $fOrdLarge $fShowLarge $fReadLarge $fNumLarge$fIntegralLarge $fRealLarge $fEnumLarge $fIxLarge $fEqSmall $fOrdSmall $fShowSmall $fReadSmall $fNumSmall$fIntegralSmall $fRealSmall $fEnumSmall $fIxSmall $fEqShrink2 $fOrdShrink2 $fShowShrink2 $fReadShrink2 $fNumShrink2$fIntegralShrink2 $fRealShrink2 $fEnumShrink2$fEqASCIIString$fOrdASCIIString$fShowASCIIString$fReadASCIIString$fEqUnicodeString$fOrdUnicodeString$fShowUnicodeString$fReadUnicodeString$fEqPrintableString$fOrdPrintableString$fShowPrintableString$fReadPrintableStringFunFunctionfunction:->Fn3Fn2FnfunctionBoundedEnumfunctionRealFracfunctionIntegral functionShow functionMapapplyapplyFun applyFun2 applyFun3 $fShow:-> $fFunctor:->$fGFunctionkM1$fGFunctionk:+:$fGFunctionk:*:$fGFunctionkU1$fGFunctionkK1$fArbitrary:->$fFunctionOrdC$fFunctionOrdB$fFunctionOrdA $fFunctionC $fFunctionB $fFunctionA$fFunctionWord64$fFunctionWord32$fFunctionWord16$fFunctionWord8$fFunctionInt64$fFunctionInt32$fFunctionInt16$fFunctionInt8 $fFunctionSeq$fFunctionIntMap$fFunctionIntSet $fFunctionMap $fFunctionSet$fFunctionComplex$fFunctionFixed$fFunctionRatio$fFunctionOrdering$fFunctionDouble$fFunctionFloat$fFunctionChar$fFunctionWord $fFunctionInt$fFunctionInteger$fFunctionBool$fFunctionMaybe $fFunction[]$fFunction(,,,,,,)$fFunction(,,,,,)$fFunction(,,,,)$fFunction(,,,)$fFunction(,,)$fFunctionEither $fFunction(,) $fFunction()$fArbitraryFun $fShowFun $fEqShrunkTerminalStrMkStrrangesnumbershortshowErroneLine isOneLinebold newTerminalwithStdioTerminalwithNullTerminalterminalOutputhandleputPartputLineputTemp $fShowStrStateMkStateterminalmaxSuccessTestsmaxDiscardedRatio computeSizenumTotMaxShrinksnumSuccessTestsnumDiscardedTestsnumRecentlyDiscardedTestslabels collectedexpectedFailure randomSeednumSuccessShrinks numTryShrinksnumTotTryShrinksResultMkResultokexpectreason theExceptionabort maybeNumTestsstamp callbackstestCase CallbackKindCounterexampleNotCounterexampleCallbackPostTestPostFinalFailureRoseMkRoseIORosePropMkPropunPropDiscardTestablepropertyProperty MkProperty unPropertymorallyDubiousIOProperty ioPropertyprotectioRosejoinRose reduceRoseonRose protectRoseprotectResults exceptionformatException protectResult succeededfailedrejectedliftBool mapResultmapTotalResult mapRoseResultmapPropmapSize shrinking noShrinkingcallbackcounterexampleshowCounterexample printTestCasewhenFail whenFail'verbose expectFailureonceagainwithMaxSuccesslabelcollectclassifycover==>withinforAll forAllShrink.&..&&.conjoin.||.disjoin===total $fMonadRose$fApplicativeRose $fFunctorRose$fTestable(->)$fTestableProperty $fTestableGen$fTestableProp$fTestableResult$fTestableBool $fTestable()$fTestableDiscardSuccessGaveUpFailureNoExpectedFailureInsufficientCoveragenumTestsoutput numShrinksnumShrinkTriesnumShrinkFinalusedSeedusedSizefailingTestCaseArgsreplay maxSuccessmaxDiscardRatiomaxSizechatty maxShrinks isSuccessstdArgs quickCheckquickCheckWithquickCheckResultquickCheckWithResult verboseCheckverboseCheckWithverboseCheckResultverboseCheckWithResulttest doneTestinggiveUprunATestfailureSummary failureReasonfailureSummaryAndReasonsummarysuccess formatLabel labelCount percentageinsufficientlyCovered foundFailurelocalMin localMin' localMinFoundcallbackPostTestcallbackPostFinalFailure $fShowArgs $fReadArgs $fShowResult PropertyM MkPropertyM unPropertyMassertprerunpickwpforAllMmonitormonadicmonadic' monadicIO monadicSTrunSTGen$fMonadIOPropertyM$fMonadTransPropertyM$fMonadFailPropertyM$fMonadPropertyM$fApplicativePropertyM$fFunctorPropertyMpolyQuickCheckpolyVerboseCheck monomorphicforAllProperties allProperties quickCheckAllverboseCheckAll$tf-random-0.5-I39p3qgWMzeLwkvBknVuZqSystem.Random.TF.GenTFGen!random-1.1-9LLJAJa4iQFLJiLXBOBXBV System.RandomStdGenbaseGHC.BaseJust GHC.GenericsGeneric gSubtermsIncl gSubterms Data.VersionVersionghc-prim GHC.TypesIntGHC.ShowShowGHC.EnumBoundedEnumGHC.RealRealFracIntegralGHC.ReadReadgenericFunctionBoolIOFalse GHC.Classes==GHC.STST integer-gmpGHC.Integer.TypeIntegerOrdStringTrue