-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Safe reimplementation of QuickCheck's core
--   
--   QuickCheck-safe reimplements the quickCheck functionality with a pure
--   interface and a very small trusted base (see
--   Test.QuickCheck.Safe.Trusted).
--   
--   <ul>
--   <li>uses the existing Arbitrary instances</li>
--   <li>implemented features: testing, result minimization (i.e.,
--   shrinking)</li>
--   <li>missing features: expected failures, label frequencies,
--   coverage</li>
--   </ul>
--   
--   The package is targeted at users who want to leverage SafeHaskell for
--   sandboxing.
--   
--   <pre>
--   &gt;&gt;&gt; putStr $ quickCheck (inventQCGen ()) (\x -&gt; length (x :: [()]) &lt; 10)
--   *** Failed! Falsifiable (after 18 tests and 3 shrinks):
--   [(),(),(),(),(),(),(),(),(),(),(),(),(),(),()]
--   </pre>
@package QuickCheck-safe
@version 0.1.0.6

module Test.QuickCheck.Safe.Trusted

-- | <a>pureEvaluate</a> wraps <a>tryEvaluate</a> in
--   <a>unsafePerformIO</a>. This may look like a dirty hack, but this
--   building block allows us to implement most of QuickCheck's
--   functionality without resorting to IO again.
pureEvaluate :: a -> Either AnException a
type AnException = SomeException

-- | <a>inventQCGen</a> invokes <a>newQCGen</a> via <a>unsafePerformIO</a>.
--   It is useful in connection with the <a>quickCheck</a> family of
--   functions.
inventQCGen :: a -> QCGen

-- | The "standard" QuickCheck random number generator. A wrapper around
--   either <a>SMGen</a> on GHC, or <a>StdGen</a> on other Haskell systems.
data () => QCGen


-- | This module implements a simplified, pure version of Test.Quickcheck's
--   quickCheck functionality.
module Test.QuickCheck.Safe

-- | Cf. <a>quickCheck</a>. Note that in contrast to QuickCheck's function,
--   this one takes an additional <a>QCGen</a> argument.
--   
--   <pre>
--   &gt;&gt;&gt; putStr $ quickCheck (inventQCGen ()) (\x -&gt; length (x :: [()]) &lt; 10)
--   *** Failed! Falsifiable (after 18 tests and 3 shrinks):
--   [(),(),(),(),(),(),(),(),(),(),(),(),(),(),()]
--   </pre>
quickCheck :: STestable prop => QCGen -> prop -> String

-- | Cf. <a>quickCheckResult</a>. Note that in contrast to QuickCheck's
--   function, this one takes an additional <a>QCGen</a> argument.
quickCheckResult :: STestable prop => QCGen -> prop -> Result

-- | Cf. <a>quickCheckWith</a>. Note that in contrast to QuickCheck's
--   function, this one takes an additional <a>QCGen</a> argument.
quickCheckWith :: STestable prop => Args -> QCGen -> prop -> String

-- | Cf. <a>quickCheckWithResult</a>. Note that in contrast to QuickCheck's
--   function, this one takes an additional <a>QCGen</a> argument.
quickCheckWithResult :: STestable prop => Args -> QCGen -> prop -> Result
class STestable prop

-- | Implication. Cf. <a>==&gt;</a>.
(==>) :: STestable prop => Bool -> prop -> SProperty

-- | Disjunction. Cf. <a>.||.</a>.
(.||.) :: (STestable prop2, STestable prop1) => prop1 -> prop2 -> SProperty

-- | Conjunction. Cf. <a>.&amp;&amp;.</a>.
(.&&.) :: (STestable prop2, STestable prop1) => prop1 -> prop2 -> SProperty

-- | Nondeterministic conjunction. Cf. <a>&amp;.</a>.
(.&.) :: (STestable prop2, STestable prop1) => prop1 -> prop2 -> SProperty

-- | Equality test. Cf. <a>===</a>.
(===) :: (Eq a, Show a) => a -> a -> SProperty

-- | Label tests. Cf. <a>label</a>.
label :: STestable prop => String -> prop -> SProperty

-- | Shrink counterexamples. Cf. <a>shrinking</a>.
shrinking :: STestable prop => (a -> [a]) -> a -> (a -> prop) -> SProperty

-- | Suppress shrinking of counterexamples. Cf. <a>noShrinking</a>.
noShrinking :: STestable prop => prop -> SProperty

-- | Adjust testcase sizes. Cf. <a>mapSize</a>.
mapSize :: STestable prop => (Int -> Int) -> prop -> SProperty

-- | Universal quantification. Cf. <a>forAll</a>.
forAll :: (Show a, STestable prop) => Gen a -> (a -> prop) -> SProperty

-- | Universal quantification with shrinking. Cf. <a>forAllShrink</a>.
forAllShrink :: (Show a, STestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> SProperty

-- | <a>inventQCGen</a> invokes <a>newQCGen</a> via <a>unsafePerformIO</a>.
--   It is useful in connection with the <a>quickCheck</a> family of
--   functions.
inventQCGen :: a -> QCGen

-- | Generation of random shrinkable, showable functions.
--   
--   To generate random values of type <tt><a>Fun</a> a b</tt>, you must
--   have an instance <tt><a>Function</a> a</tt>.
--   
--   See also <a>applyFun</a>, and <a>Fn</a> with GHC &gt;= 7.8.
data () => Fun a b
Fun :: (a :-> b, b, Shrunk) -> (a -> b) -> Fun a b

-- | A generator for values of type <tt>a</tt>.
--   
--   The third-party packages <a>QuickCheck-GenT</a> and
--   <a>quickcheck-transformer</a> provide monad transformer versions of
--   <tt>Gen</tt>.
data () => Gen a

-- | Used for random generation of functions. You should consider using
--   <a>Fun</a> instead, which can show the generated functions as strings.
--   
--   If you are using a recent GHC, there is a default definition of
--   <a>coarbitrary</a> using <a>genericCoarbitrary</a>, so if your type
--   has a <a>Generic</a> instance it's enough to say
--   
--   <pre>
--   instance CoArbitrary MyType
--   </pre>
--   
--   You should only use <a>genericCoarbitrary</a> 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 <tt>coarbitrary s = coarbitrary (toList s)</tt>.
class () => CoArbitrary a

-- | Used to generate a function of type <tt>a -&gt; b</tt>. The first
--   argument is a value, the second a generator. You should use
--   <a>variant</a> to perturb the random generator; the goal is that
--   different values for the first argument will lead to different calls
--   to <a>variant</a>. An example will help:
--   
--   <pre>
--   instance CoArbitrary a =&gt; CoArbitrary [a] where
--     coarbitrary []     = <a>variant</a> 0
--     coarbitrary (x:xs) = <a>variant</a> 1 . coarbitrary (x,xs)
--   </pre>
coarbitrary :: CoArbitrary a => a -> Gen b -> Gen b

-- | Lifting of the <a>Arbitrary</a> class to binary type constructors.
class () => Arbitrary2 (f :: Type -> Type -> Type)
liftArbitrary2 :: Arbitrary2 f => Gen a -> Gen b -> Gen (f a b)
liftShrink2 :: Arbitrary2 f => (a -> [a]) -> (b -> [b]) -> f a b -> [f a b]

-- | Lifting of the <a>Arbitrary</a> class to unary type constructors.
class () => Arbitrary1 (f :: Type -> Type)
liftArbitrary :: Arbitrary1 f => Gen a -> Gen (f a)
liftShrink :: Arbitrary1 f => (a -> [a]) -> f a -> [f a]

-- | Random generation and shrinking of values.
--   
--   QuickCheck provides <tt>Arbitrary</tt> instances for most types in
--   <tt>base</tt>, except those which incur extra dependencies. For a
--   wider range of <tt>Arbitrary</tt> instances see the
--   <a>quickcheck-instances</a> package.
class () => Arbitrary a

-- | 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 <a>sample</a>, <tt>label</tt> and
--   <tt>classify</tt> to check the quality of your test data.
--   
--   There is no generic <tt>arbitrary</tt> implementation included because
--   we don't know how to make a high-quality one. If you want one,
--   consider using the <a>testing-feat</a> or <a>generic-random</a>
--   packages.
--   
--   The <a>QuickCheck manual</a> goes into detail on how to write good
--   generators. Make sure to look at it, especially if your type is
--   recursive!
arbitrary :: Arbitrary a => Gen a

-- | 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 <tt>shrink = <a>genericShrink</a></tt>,
--   but by customising the behaviour of <tt>shrink</tt> you can often get
--   simpler counterexamples.
--   
--   Most implementations of <a>shrink</a> should try at least three
--   things:
--   
--   <ol>
--   <li>Shrink a term to any of its immediate subterms. You can use
--   <a>subterms</a> to do this.</li>
--   <li>Recursively apply <a>shrink</a> to all immediate subterms. You can
--   use <a>recursivelyShrink</a> to do this.</li>
--   <li>Type-specific shrinkings such as replacing a constructor by a
--   simpler constructor.</li>
--   </ol>
--   
--   For example, suppose we have the following implementation of binary
--   trees:
--   
--   <pre>
--   data Tree a = Nil | Branch a (Tree a) (Tree a)
--   </pre>
--   
--   We can then define <a>shrink</a> as follows:
--   
--   <pre>
--   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') &lt;- shrink (x, l, r)]
--   </pre>
--   
--   There are a couple of subtleties here:
--   
--   <ul>
--   <li>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 <tt>Nil</tt>) before smaller ones (such as
--   recursively shrinking the subtrees).</li>
--   <li>It is tempting to write the last line as <tt>[Branch x' l' r' | x'
--   &lt;- shrink x, l' &lt;- shrink l, r' &lt;- shrink r]</tt> but this is
--   the <i>wrong thing</i>! It will force QuickCheck to shrink <tt>x</tt>,
--   <tt>l</tt> and <tt>r</tt> in tandem, and shrinking will stop once
--   <i>one</i> of the three is fully shrunk.</li>
--   </ul>
--   
--   There is a fair bit of boilerplate in the code above. We can avoid it
--   with the help of some generic functions. The function
--   <a>genericShrink</a> tries shrinking a term to all of its subterms
--   and, failing that, recursively shrinks the subterms. Using it, we can
--   define <a>shrink</a> as:
--   
--   <pre>
--   shrink x = shrinkToNil x ++ genericShrink x
--     where
--       shrinkToNil Nil = []
--       shrinkToNil (Branch _ l r) = [Nil]
--   </pre>
--   
--   <a>genericShrink</a> is a combination of <a>subterms</a>, which
--   shrinks a term to any of its subterms, and <a>recursivelyShrink</a>,
--   which shrinks all subterms of a term. These may be useful if you need
--   a bit more control over shrinking than <a>genericShrink</a> gives you.
--   
--   A final gotcha: we cannot define <a>shrink</a> as simply
--   <tt><a>shrink</a> x = Nil:<a>genericShrink</a> x</tt> as this shrinks
--   <tt>Nil</tt> to <tt>Nil</tt>, and shrinking will go into an infinite
--   loop.
--   
--   If all this leaves you bewildered, you might try <tt><a>shrink</a> =
--   <a>genericShrink</a></tt> to begin with, after deriving
--   <tt>Generic</tt> for your type. However, if your data type has any
--   special invariants, you will need to check that <a>genericShrink</a>
--   can't break those invariants.
shrink :: Arbitrary a => a -> [a]

-- | <tt>PrintableString</tt>: generates a printable unicode String. The
--   string will not contain surrogate pairs.
newtype () => PrintableString
PrintableString :: String -> PrintableString
[getPrintableString] :: PrintableString -> String

-- | <tt>UnicodeString</tt>: generates a unicode String. The string will
--   not contain surrogate pairs.
newtype () => UnicodeString
UnicodeString :: String -> UnicodeString
[getUnicodeString] :: UnicodeString -> String

-- | <tt>ASCIIString</tt>: generates an ASCII string.
newtype () => ASCIIString
ASCIIString :: String -> ASCIIString
[getASCIIString] :: ASCIIString -> String
class () => ShrinkState s a
shrinkInit :: ShrinkState s a => a -> s
shrinkState :: ShrinkState s a => a -> s -> [(a, s)]

-- | <tt>Shrinking _ x</tt>: allows for maintaining a state during
--   shrinking.
data () => Shrinking s a
Shrinking :: s -> a -> Shrinking s a

-- | <tt>Smart _ x</tt>: tries a different order when shrinking.
data () => Smart a
Smart :: Int -> a -> Smart a

-- | <tt>Shrink2 x</tt>: allows 2 shrinking steps at the same time when
--   shrinking x
newtype () => Shrink2 a
Shrink2 :: a -> Shrink2 a
[getShrink2] :: Shrink2 a -> a

-- | <tt>Small x</tt>: generates values of <tt>x</tt> drawn from a small
--   range. The opposite of <a>Large</a>.
newtype () => Small a
Small :: a -> Small a
[getSmall] :: Small a -> a

-- | <tt>Large x</tt>: by default, QuickCheck generates <a>Int</a>s drawn
--   from a small range. <tt>Large Int</tt> gives you values drawn from the
--   entire range instead.
newtype () => Large a
Large :: a -> Large a
[getLarge] :: Large a -> a

-- | <tt>NonPositive x</tt>: guarantees that <tt>x &lt;= 0</tt>.
newtype () => NonPositive a
NonPositive :: a -> NonPositive a
[getNonPositive] :: NonPositive a -> a

-- | <tt>NonNegative x</tt>: guarantees that <tt>x &gt;= 0</tt>.
newtype () => NonNegative a
NonNegative :: a -> NonNegative a
[getNonNegative] :: NonNegative a -> a

-- | <tt>NonZero x</tt>: guarantees that <tt>x /= 0</tt>.
newtype () => NonZero a
NonZero :: a -> NonZero a
[getNonZero] :: NonZero a -> a

-- | <tt>Negative x</tt>: guarantees that <tt>x &lt; 0</tt>.
newtype () => Negative a
Negative :: a -> Negative a
[getNegative] :: Negative a -> a

-- | <tt>Positive x</tt>: guarantees that <tt>x &gt; 0</tt>.
newtype () => Positive a
Positive :: a -> Positive a
[getPositive] :: Positive a -> a

-- | <tt>Sorted xs</tt>: guarantees that xs is sorted.
newtype () => SortedList a
Sorted :: [a] -> SortedList a
[getSorted] :: SortedList a -> [a]

-- | <tt>InfiniteList xs _</tt>: 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:
--   
--   <pre>
--   prop_take_10 :: InfiniteList Char -&gt; Bool
--   prop_take_10 (InfiniteList xs _) =
--     or [ x == 'a' | x &lt;- take 10 xs ]
--   </pre>
--   
--   In the following counterexample, the list must start with
--   <tt>"bbbbbbbbbb"</tt> but the remaining (infinite) part can contain
--   anything:
--   
--   <pre>
--   &gt;&gt;&gt; quickCheck prop_take_10
--   *** Failed! Falsified (after 1 test and 14 shrinks):
--   "bbbbbbbbbb" ++ ...
--   </pre>
data () => InfiniteList a
InfiniteList :: [a] -> InfiniteListInternalData a -> InfiniteList a
[getInfiniteList] :: InfiniteList a -> [a]
[infiniteListInternalData] :: InfiniteList a -> InfiniteListInternalData a

-- | <tt>NonEmpty xs</tt>: guarantees that xs is non-empty.
newtype () => NonEmptyList a
NonEmpty :: [a] -> NonEmptyList a
[getNonEmpty] :: NonEmptyList a -> [a]

-- | <tt>Ordered xs</tt>: guarantees that xs is ordered.
newtype () => OrderedList a
Ordered :: [a] -> OrderedList a
[getOrdered] :: OrderedList a -> [a]

-- | <tt>Fixed x</tt>: as x, but will not be shrunk.
newtype () => Fixed a
Fixed :: a -> Fixed a
[getFixed] :: Fixed a -> a

-- | <tt>Blind x</tt>: as x, but x does not have to be in the <a>Show</a>
--   class.
newtype () => Blind a
Blind :: a -> Blind a
[getBlind] :: Blind a -> a

-- | The class <tt>Function a</tt> is used for random generation of
--   showable functions of type <tt>a -&gt; b</tt>.
--   
--   There is a default implementation for <a>function</a>, which you can
--   use if your type has structural equality. Otherwise, you can normally
--   use <a>functionMap</a> or <a>functionShow</a>.
class () => Function a
function :: Function a => (a -> b) -> a :-> b

-- | The statistical parameters used by <tt>checkCoverage</tt>.
data () => Confidence
Confidence :: Integer -> Double -> Confidence

-- | How certain <tt>checkCoverage</tt> must be before the property fails.
--   If the coverage requirement is met, and the certainty parameter is
--   <tt>n</tt>, then you should get a false positive at most one in
--   <tt>n</tt> runs of QuickCheck. The default value is <tt>10^9</tt>.
--   
--   Lower values will speed up <tt>checkCoverage</tt> at the cost of false
--   positives.
--   
--   If you are using <tt>checkCoverage</tt> as part of a test suite, you
--   should be careful not to set <tt>certainty</tt> too low. If you want,
--   say, a 1% chance of a false positive during a project's lifetime, then
--   <tt>certainty</tt> should be set to at least <tt>100 * m * n</tt>,
--   where <tt>m</tt> is the number of uses of <tt>cover</tt> in the test
--   suite, and <tt>n</tt> is the number of times you expect the test suite
--   to be run during the project's lifetime. The default value is chosen
--   to be big enough for most projects.
[certainty] :: Confidence -> Integer

-- | For statistical reasons, <tt>checkCoverage</tt> will not reject
--   coverage levels that are only slightly below the required levels. If
--   the required level is <tt>p</tt> then an actual level of <tt>tolerance
--   * p</tt> will be accepted. The default value is <tt>0.9</tt>.
--   
--   Lower values will speed up <tt>checkCoverage</tt> at the cost of not
--   detecting minor coverage violations.
[tolerance] :: Confidence -> Double

-- | If a property returns <a>Discard</a>, the current test case is
--   discarded, the same as if a precondition was false.
--   
--   An example is the definition of <a>==&gt;</a>:
--   
--   <pre>
--   (==&gt;) :: Testable prop =&gt; Bool -&gt; prop -&gt; Property
--   False ==&gt; _ = property Discard
--   True  ==&gt; p = property p
--   </pre>
data () => Discard
Discard :: Discard

-- | Result represents the test result
data () => Result

-- | A successful test run
Success :: Int -> Int -> !Map [String] Int -> !Map String Int -> !Map String (Map String Int) -> String -> Result

-- | Number of tests performed
[numTests] :: Result -> Int

-- | Number of tests skipped
[numDiscarded] :: Result -> Int

-- | The number of test cases having each combination of labels (see
--   <a>label</a>)
[labels] :: Result -> !Map [String] Int

-- | The number of test cases having each class (see <a>classify</a>)
[classes] :: Result -> !Map String Int

-- | Data collected by <a>tabulate</a>
[tables] :: Result -> !Map String (Map String Int)

-- | Printed output
[output] :: Result -> String

-- | Given up
GaveUp :: Int -> Int -> !Map [String] Int -> !Map String Int -> !Map String (Map String Int) -> String -> Result

-- | Number of tests performed
[numTests] :: Result -> Int

-- | Number of tests skipped
[numDiscarded] :: Result -> Int

-- | The number of test cases having each combination of labels (see
--   <a>label</a>)
[labels] :: Result -> !Map [String] Int

-- | The number of test cases having each class (see <a>classify</a>)
[classes] :: Result -> !Map String Int

-- | Data collected by <a>tabulate</a>
[tables] :: Result -> !Map String (Map String Int)

-- | Printed output
[output] :: Result -> String

-- | A failed test run
Failure :: Int -> Int -> Int -> Int -> Int -> QCGen -> Int -> String -> Maybe AnException -> String -> [String] -> [String] -> Set String -> Result

-- | Number of tests performed
[numTests] :: Result -> Int

-- | Number of tests skipped
[numDiscarded] :: Result -> Int

-- | Number of successful shrinking steps performed
[numShrinks] :: Result -> Int

-- | Number of unsuccessful shrinking steps performed
[numShrinkTries] :: Result -> Int

-- | Number of unsuccessful shrinking steps performed since last successful
--   shrink
[numShrinkFinal] :: Result -> Int

-- | What seed was used
[usedSeed] :: Result -> QCGen

-- | What was the test size
[usedSize] :: Result -> Int

-- | Why did the property fail
[reason] :: Result -> String

-- | The exception the property threw, if any
[theException] :: Result -> Maybe AnException

-- | Printed output
[output] :: Result -> String

-- | The test case which provoked the failure
[failingTestCase] :: Result -> [String]

-- | The test case's labels (see <a>label</a>)
[failingLabels] :: Result -> [String]

-- | The test case's classes (see <a>classify</a>)
[failingClasses] :: Result -> Set String

-- | A property that should have failed did not
NoExpectedFailure :: Int -> Int -> !Map [String] Int -> !Map String Int -> !Map String (Map String Int) -> String -> Result

-- | Number of tests performed
[numTests] :: Result -> Int

-- | Number of tests skipped
[numDiscarded] :: Result -> Int

-- | The number of test cases having each combination of labels (see
--   <a>label</a>)
[labels] :: Result -> !Map [String] Int

-- | The number of test cases having each class (see <a>classify</a>)
[classes] :: Result -> !Map String Int

-- | Data collected by <a>tabulate</a>
[tables] :: Result -> !Map String (Map String Int)

-- | Printed output
[output] :: Result -> String

-- | Args specifies arguments to the QuickCheck driver
data () => Args
Args :: Maybe (QCGen, Int) -> Int -> Int -> Int -> Bool -> Int -> Args

-- | Should 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.
[replay] :: Args -> Maybe (QCGen, Int)

-- | Maximum 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.
[maxSuccess] :: Args -> Int

-- | Maximum number of discarded tests per successful test before giving up
[maxDiscardRatio] :: Args -> Int

-- | Size to use for the biggest test cases
[maxSize] :: Args -> Int

-- | Whether to print anything
[chatty] :: Args -> Bool

-- | Maximum number of shrinks to before giving up. Setting this to zero
--   turns shrinking off.
[maxShrinks] :: Args -> Int

-- | A modifier for testing ternary functions.
pattern Fn3 :: (a -> b -> c -> d) -> Fun (a, b, c) d

-- | A modifier for testing binary functions.
--   
--   <pre>
--   prop_zipWith :: Fun (Int, Bool) Char -&gt; [Int] -&gt; [Bool] -&gt; Bool
--   prop_zipWith (Fn2 f) xs ys = zipWith f xs ys == [ f x y | (x, y) &lt;- zip xs ys]
--   </pre>
pattern Fn2 :: (a -> b -> c) -> Fun (a, b) c

-- | A modifier for testing functions.
--   
--   <pre>
--   prop :: Fun String Integer -&gt; Bool
--   prop (Fn f) = f "banana" == f "monkey"
--              || f "banana" == f "elephant"
--   </pre>
pattern Fn :: (a -> b) -> Fun a b

-- | A special error value. If a property evaluates <a>discard</a>, it
--   causes QuickCheck to discard the current test case. This can be useful
--   if you want to discard the current test case, but are somewhere you
--   can't use <a>==&gt;</a>, such as inside a generator.
discard :: a

-- | Modifies a generator using an integer seed.
variant :: Integral n => n -> Gen a -> Gen a

-- | Used to construct generators that depend on the size parameter.
--   
--   For example, <a>listOf</a>, which uses the size parameter as an upper
--   bound on length of lists it generates, can be defined like this:
--   
--   <pre>
--   listOf :: Gen a -&gt; Gen [a]
--   listOf gen = sized $ \n -&gt;
--     do k &lt;- choose (0,n)
--        vectorOf k gen
--   </pre>
--   
--   You can also do this using <a>getSize</a>.
sized :: (Int -> Gen a) -> Gen a

-- | Returns the size parameter. Used to construct generators that depend
--   on the size parameter.
--   
--   For example, <a>listOf</a>, which uses the size parameter as an upper
--   bound on length of lists it generates, can be defined like this:
--   
--   <pre>
--   listOf :: Gen a -&gt; Gen [a]
--   listOf gen = do
--     n &lt;- getSize
--     k &lt;- choose (0,n)
--     vectorOf k gen
--   </pre>
--   
--   You can also do this using <a>sized</a>.
getSize :: Gen Int

-- | Overrides the size parameter. Returns a generator which uses the given
--   size instead of the runtime-size parameter.
resize :: Int -> Gen a -> Gen a

-- | Adjust the size parameter, by transforming it with the given function.
scale :: (Int -> Int) -> Gen a -> Gen a

-- | Generates a random element in the given inclusive range. For integral
--   and enumerated types, the specialised variants of <a>choose</a> below
--   run much quicker.
choose :: Random a => (a, a) -> Gen a

-- | Generates a random element over the natural range of <tt>a</tt>.
chooseAny :: Random a => Gen a

-- | A fast implementation of <a>choose</a> for enumerated types.
chooseEnum :: Enum a => (a, a) -> Gen a

-- | A fast implementation of <a>choose</a> for <a>Int</a>.
chooseInt :: (Int, Int) -> Gen Int

-- | A fast implementation of <a>choose</a> for bounded integral types.
chooseBoundedIntegral :: (Bounded a, Integral a) => (a, a) -> Gen a

-- | A fast implementation of <a>choose</a> for <a>Integer</a>.
chooseInteger :: (Integer, Integer) -> Gen Integer

-- | Run a generator. The size passed to the generator is always 30; if you
--   want another size then you should explicitly use <a>resize</a>.
generate :: Gen a -> IO a

-- | Generates some example values.
sample' :: Gen a -> IO [a]

-- | Generates some example values and prints them to <tt>stdout</tt>.
sample :: Show a => Gen a -> IO ()

-- | Generates a value that satisfies a predicate.
suchThat :: Gen a -> (a -> Bool) -> Gen a

-- | Generates a value for which the given function returns a <a>Just</a>,
--   and then applies the function.
suchThatMap :: Gen a -> (a -> Maybe b) -> Gen b

-- | Tries to generate a value that satisfies a predicate. If it fails to
--   do so after enough attempts, returns <tt>Nothing</tt>.
suchThatMaybe :: Gen a -> (a -> Bool) -> Gen (Maybe a)

-- | Randomly uses one of the given generators. The input list must be
--   non-empty.
oneof :: [Gen a] -> Gen a

-- | Chooses one of the given generators, with a weighted random
--   distribution. The input list must be non-empty.
frequency :: [(Int, Gen a)] -> Gen a

-- | Generates one of the given values. The input list must be non-empty.
elements :: [a] -> Gen a

-- | Generates a random subsequence of the given list.
sublistOf :: [a] -> Gen [a]

-- | Generates a random permutation of the given list.
shuffle :: [a] -> Gen [a]

-- | Takes 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.
growingElements :: [a] -> Gen a

-- | Generates a list of random length. The maximum length depends on the
--   size parameter.
listOf :: Gen a -> Gen [a]

-- | Generates a non-empty list of random length. The maximum length
--   depends on the size parameter.
listOf1 :: Gen a -> Gen [a]

-- | Generates a list of the given length.
vectorOf :: Int -> Gen a -> Gen [a]

-- | Generates an infinite list.
infiniteListOf :: Gen a -> Gen [a]
arbitrary1 :: (Arbitrary1 f, Arbitrary a) => Gen (f a)
shrink1 :: (Arbitrary1 f, Arbitrary a) => f a -> [f a]
arbitrary2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => Gen (f a b)
shrink2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => f a b -> [f a b]

-- | Shrink a term to any of its immediate subterms, and also recursively
--   shrink all subterms.
genericShrink :: (Generic a, RecursivelyShrink (Rep a), GSubterms (Rep a) a) => a -> [a]

-- | Recursively shrink all immediate subterms.
recursivelyShrink :: (Generic a, RecursivelyShrink (Rep a)) => a -> [a]

-- | All immediate subterms of a term.
subterms :: (Generic a, GSubterms (Rep a) a) => a -> [a]

-- | Shrink a list of values given a shrinking function for individual
--   values.
shrinkList :: (a -> [a]) -> [a] -> [[a]]

-- | Apply a binary function to random arguments.
applyArbitrary2 :: (Arbitrary a, Arbitrary b) => (a -> b -> r) -> Gen r

-- | Apply a ternary function to random arguments.
applyArbitrary3 :: (Arbitrary a, Arbitrary b, Arbitrary c) => (a -> b -> c -> r) -> Gen r

-- | Apply a function of arity 4 to random arguments.
applyArbitrary4 :: (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => (a -> b -> c -> d -> r) -> Gen r

-- | Generates an integral number. The number can be positive or negative
--   and its maximum absolute value depends on the size parameter.
arbitrarySizedIntegral :: Integral a => Gen a

-- | Generates a natural number. The number's maximum value depends on the
--   size parameter.
arbitrarySizedNatural :: Integral a => Gen a

-- | Uniformly generates a fractional number. The number can be positive or
--   negative and its maximum absolute value depends on the size parameter.
arbitrarySizedFractional :: Fractional a => Gen a

-- | Generates an integral number. The number is chosen uniformly from the
--   entire range of the type. You may want to use
--   <a>arbitrarySizedBoundedIntegral</a> instead.
arbitraryBoundedIntegral :: (Bounded a, Integral a) => Gen a

-- | Generates an element of a bounded type. The element is chosen from the
--   entire range of the type.
arbitraryBoundedRandom :: (Bounded a, Random a) => Gen a

-- | Generates an element of a bounded enumeration.
arbitraryBoundedEnum :: (Bounded a, Enum a) => Gen a

-- | Generates 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.
arbitrarySizedBoundedIntegral :: (Bounded a, Integral a) => Gen a

-- | Generates any Unicode character (but not a surrogate)
arbitraryUnicodeChar :: Gen Char

-- | Generates a random ASCII character (0-127).
arbitraryASCIIChar :: Gen Char

-- | Generates a printable Unicode character.
arbitraryPrintableChar :: Gen Char

-- | Returns no shrinking alternatives.
shrinkNothing :: a -> [a]

-- | Map a shrink function to another domain. This is handy if your data
--   type has special invariants, but is <i>almost</i> isomorphic to some
--   other type.
--   
--   <pre>
--   shrinkOrderedList :: (Ord a, Arbitrary a) =&gt; [a] -&gt; [[a]]
--   shrinkOrderedList = shrinkMap sort id
--   
--   shrinkSet :: (Ord a, Arbitrary a) =&gt; Set a -&gt; [Set a]
--   shrinkSet = shrinkMap fromList toList
--   </pre>
shrinkMap :: Arbitrary a => (a -> b) -> (b -> a) -> b -> [b]

-- | Non-overloaded version of <a>shrinkMap</a>.
shrinkMapBy :: (a -> b) -> (b -> a) -> (a -> [a]) -> b -> [b]

-- | Shrink an integral number.
shrinkIntegral :: Integral a => a -> [a]

-- | Shrink an element of a bounded enumeration.
--   
--   <h3><b>Example</b></h3>
--   
--   <pre>
--   data MyEnum = E0 | E1 | E2 | E3 | E4 | E5 | E6 | E7 | E8 | E9
--      deriving (Bounded, Enum, Eq, Ord, Show)
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; shrinkBoundedEnum E9
--   [E0,E5,E7,E8]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; shrinkBoundedEnum E5
--   [E0,E3,E4]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; shrinkBoundedEnum E0
--   []
--   </pre>
shrinkBoundedEnum :: (Bounded a, Enum a, Eq a) => a -> [a]

-- | Shrink a fraction, preferring numbers with smaller numerators or
--   denominators. See also <a>shrinkDecimal</a>.
shrinkRealFrac :: RealFrac a => a -> [a]

-- | Shrink a real number, preferring numbers with shorter decimal
--   representations. See also <a>shrinkRealFrac</a>.
shrinkDecimal :: RealFrac a => a -> [a]

-- | Generic CoArbitrary implementation.
genericCoarbitrary :: (Generic a, GCoArbitrary (Rep a)) => a -> Gen b -> Gen b

-- | Combine two generator perturbing functions, for example the results of
--   calls to <a>variant</a> or <a>coarbitrary</a>.
(><) :: (Gen a -> Gen a) -> (Gen a -> Gen a) -> Gen a -> Gen a

-- | A <a>coarbitrary</a> implementation for integral numbers.
coarbitraryIntegral :: Integral a => a -> Gen b -> Gen b

-- | A <a>coarbitrary</a> implementation for real numbers.
coarbitraryReal :: Real a => a -> Gen b -> Gen b

-- | <a>coarbitrary</a> helper for lazy people :-).
coarbitraryShow :: Show a => a -> Gen b -> Gen b

-- | A <a>coarbitrary</a> implementation for enums.
coarbitraryEnum :: Enum a => a -> Gen b -> Gen b

-- | Generates a list of a given length.
vector :: Arbitrary a => Int -> Gen [a]

-- | Generates an ordered list.
orderedList :: (Ord a, Arbitrary a) => Gen [a]

-- | Generates an infinite list.
infiniteList :: Arbitrary a => Gen [a]

-- | Provides a <a>Function</a> instance for types with <a>Bounded</a> and
--   <a>Enum</a>. Use only for small types (i.e. not integers): creates the
--   list <tt>[<a>minBound</a>..<a>maxBound</a>]</tt>!
functionBoundedEnum :: (Eq a, Bounded a, Enum a) => (a -> b) -> a :-> b

-- | Provides a <a>Function</a> instance for types with <a>RealFrac</a>.
functionRealFrac :: RealFrac a => (a -> b) -> a :-> b

-- | Provides a <a>Function</a> instance for types with <a>Integral</a>.
functionIntegral :: Integral a => (a -> b) -> a :-> b

-- | Provides a <a>Function</a> instance for types with <a>Show</a> and
--   <a>Read</a>.
functionShow :: (Show a, Read a) => (a -> c) -> a :-> c

-- | Provides a <a>Function</a> instance for types isomorphic to
--   <a>Void</a>.
--   
--   An actual <tt><a>Function</a> <a>Void</a></tt> instance is defined in
--   <tt>quickcheck-instances</tt>.
functionVoid :: (forall b. () => void -> b) -> void :-> c

-- | The basic building block for <a>Function</a> instances. Provides a
--   <a>Function</a> instance by mapping to and from a type that already
--   has a <a>Function</a> instance.
functionMap :: Function b => (a -> b) -> (b -> a) -> (a -> c) -> a :-> c

-- | Extracts the value of a function.
--   
--   <a>Fn</a> is the pattern equivalent of this function.
--   
--   <pre>
--   prop :: Fun String Integer -&gt; Bool
--   prop f = applyFun f "banana" == applyFun f "monkey"
--         || applyFun f "banana" == applyFun f "elephant"
--   </pre>
applyFun :: Fun a b -> a -> b

-- | Extracts the value of a binary function.
--   
--   <a>Fn2</a> is the pattern equivalent of this function.
--   
--   <pre>
--   prop_zipWith :: Fun (Int, Bool) Char -&gt; [Int] -&gt; [Bool] -&gt; Bool
--   prop_zipWith f xs ys = zipWith (applyFun2 f) xs ys == [ applyFun2 f x y | (x, y) &lt;- zip xs ys]
--   </pre>
applyFun2 :: Fun (a, b) c -> a -> b -> c

-- | Extracts the value of a ternary function. <a>Fn3</a> is the pattern
--   equivalent of this function.
applyFun3 :: Fun (a, b, c) d -> a -> b -> c -> d

-- | Do I/O inside a property.
--   
--   Warning: any random values generated inside of the argument to
--   <tt>ioProperty</tt> will not currently be shrunk. For best results,
--   generate all random values before calling <tt>ioProperty</tt>, or use
--   <a>idempotentIOProperty</a> if that is safe.
--   
--   Note: if your property does no quantification, it will only be tested
--   once. To test it repeatedly, use <a>again</a>.
ioProperty :: Testable prop => IO prop -> Property

-- | Do I/O inside a property.
--   
--   Warning: during shrinking, the I/O may not always be re-executed.
--   Instead, the I/O may be executed once and then its result retained. If
--   this is not acceptable, use <a>ioProperty</a> instead.
idempotentIOProperty :: Testable prop => IO prop -> Property

-- | Performs an <a>IO</a> action after the last failure of a property.
whenFail :: Testable prop => IO () -> prop -> Property

-- | Performs an <a>IO</a> action every time a property fails. Thus, if
--   shrinking is done, this can be used to keep track of the failures
--   along the way.
whenFail' :: Testable prop => IO () -> prop -> Property

-- | Prints out the generated test case every time the property fails,
--   including during shrinking. Only variables quantified over
--   <i>inside</i> the <a>verboseShrinking</a> are printed.
--   
--   Note: for technical reasons, the test case is printed out <i>after</i>
--   the property is tested. To debug a property that goes into an infinite
--   loop, use <a>within</a> to add a timeout instead.
verboseShrinking :: Testable prop => prop -> Property

-- | Modifies a property so that it will be tested repeatedly. Opposite of
--   <a>once</a>.
again :: Testable prop => prop -> Property

-- | Configures how many times a property will be tested.
--   
--   For example,
--   
--   <pre>
--   quickCheck (withMaxSuccess 1000 p)
--   </pre>
--   
--   will test <tt>p</tt> up to 1000 times.
withMaxSuccess :: Testable prop => Int -> prop -> Property

-- | Check that all coverage requirements defined by <a>cover</a> and
--   <a>coverTable</a> are met, using a statistically sound test, and fail
--   if they are not met.
--   
--   Ordinarily, a failed coverage check does not cause the property to
--   fail. This is because the coverage requirement is not tested in a
--   statistically sound way. If you use <a>cover</a> to express that a
--   certain value must appear 20% of the time, QuickCheck will warn you if
--   the value only appears in 19 out of 100 test cases - but since the
--   coverage varies randomly, you may have just been unlucky, and there
--   may not be any real problem with your test generation.
--   
--   When you use <a>checkCoverage</a>, QuickCheck uses a statistical test
--   to account for the role of luck in coverage failures. It will run as
--   many tests as needed until it is sure about whether the coverage
--   requirements are met. If a coverage requirement is not met, the
--   property fails.
--   
--   Example:
--   
--   <pre>
--   quickCheck (checkCoverage prop_foo)
--   </pre>
checkCoverage :: Testable prop => prop -> Property

-- | Check coverage requirements using a custom confidence level. See
--   <a>stdConfidence</a>.
--   
--   An example of making the statistical test less stringent in order to
--   improve performance:
--   
--   <pre>
--   quickCheck (checkCoverageWith stdConfidence{certainty = 10^6} prop_foo)
--   </pre>
checkCoverageWith :: Testable prop => Confidence -> prop -> Property

-- | The standard parameters used by <a>checkCoverage</a>: <tt>certainty =
--   10^9</tt>, <tt>tolerance = 0.9</tt>. See <a>Confidence</a> for the
--   meaning of the parameters.
stdConfidence :: Confidence

-- | Collects information about test case distribution into a table. The
--   arguments to <a>tabulate</a> are the table's name and a list of values
--   associated with the current test case. After testing, QuickCheck
--   prints the frequency of all collected values. The frequencies are
--   expressed as a percentage of the total number of values collected.
--   
--   You should prefer <a>tabulate</a> to <a>label</a> when each test case
--   is associated with a varying number of values. Here is a (not terribly
--   useful) example, where the test data is a list of integers and we
--   record all values that occur in the list:
--   
--   <pre>
--   prop_sorted_sort :: [Int] -&gt; Property
--   prop_sorted_sort xs =
--     sorted xs ==&gt;
--     tabulate "List elements" (map show xs) $
--     sort xs === xs
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; quickCheck prop_sorted_sort
--   +++ OK, passed 100 tests; 1684 discarded.
--   
--   List elements (109 in total):
--    3.7% 0
--    3.7% 17
--    3.7% 2
--    3.7% 6
--    2.8% -6
--    2.8% -7
--   </pre>
--   
--   Here is a more useful example. We are testing a chatroom, where the
--   user can log in, log out, or send a message:
--   
--   <pre>
--   data Command = LogIn | LogOut | SendMessage String deriving (Data, Show)
--   instance Arbitrary Command where ...
--   </pre>
--   
--   There are some restrictions on command sequences; for example, the
--   user must log in before doing anything else. The function <tt>valid ::
--   [Command] -&gt; Bool</tt> checks that a command sequence is allowed.
--   Our property then has the form:
--   
--   <pre>
--   prop_chatroom :: [Command] -&gt; Property
--   prop_chatroom cmds =
--     valid cmds ==&gt;
--       ...
--   </pre>
--   
--   The use of <a>==&gt;</a> may skew test case distribution. We use
--   <a>collect</a> to see the length of the command sequences, and
--   <a>tabulate</a> to get the frequencies of the individual commands:
--   
--   <pre>
--   prop_chatroom :: [Command] -&gt; Property
--   prop_chatroom cmds =
--     wellFormed cmds LoggedOut ==&gt;
--     'collect' (length cmds) $
--     'tabulate' "Commands" (map (show . 'Data.Data.toConstr') cmds) $
--       ...
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; quickCheckWith stdArgs{maxDiscardRatio = 1000} prop_chatroom
--   +++ OK, passed 100 tests; 2775 discarded:
--   60% 0
--   20% 1
--   15% 2
--    3% 3
--    1% 4
--    1% 5
--   
--   Commands (68 in total):
--   62% LogIn
--   22% SendMessage
--   16% LogOut
--   </pre>
tabulate :: Testable prop => String -> [String] -> prop -> Property

-- | Checks that the values in a given <tt>table</tt> appear a certain
--   proportion of the time. A call to <a>coverTable</a> <tt>table</tt>
--   <tt>[(x1, p1), ..., (xn, pn)]</tt> asserts that of the values in
--   <tt>table</tt>, <tt>x1</tt> should appear at least <tt>p1</tt> percent
--   of the time, <tt>x2</tt> at least <tt>p2</tt> percent of the time, and
--   so on.
--   
--   <b>Note:</b> If the coverage check fails, QuickCheck prints out a
--   warning, but the property does <i>not</i> fail. To make the property
--   fail, use <a>checkCoverage</a>.
--   
--   Continuing the example from the <tt>tabular</tt> combinator...
--   
--   <pre>
--   data Command = LogIn | LogOut | SendMessage String deriving (Data, Show)
--   prop_chatroom :: [Command] -&gt; Property
--   prop_chatroom cmds =
--     wellFormed cmds LoggedOut ==&gt;
--     'tabulate' "Commands" (map (show . 'Data.Data.toConstr') cmds) $
--       ...
--   </pre>
--   
--   ...we can add a coverage requirement as follows, which checks that
--   <tt>LogIn</tt>, <tt>LogOut</tt> and <tt>SendMessage</tt> each occur at
--   least 25% of the time:
--   
--   <pre>
--   prop_chatroom :: [Command] -&gt; Property
--   prop_chatroom cmds =
--     wellFormed cmds LoggedOut ==&gt;
--     coverTable "Commands" [("LogIn", 25), ("LogOut", 25), ("SendMessage", 25)] $
--     'tabulate' "Commands" (map (show . 'Data.Data.toConstr') cmds) $
--       ... property goes here ...
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; quickCheck prop_chatroom
--   +++ OK, passed 100 tests; 2909 discarded:
--   56% 0
--   17% 1
--   10% 2
--    6% 3
--    5% 4
--    3% 5
--    3% 7
--   
--   Commands (111 in total):
--   51.4% LogIn
--   30.6% SendMessage
--   18.0% LogOut
--   
--   Table 'Commands' had only 18.0% LogOut, but expected 25.0%
--   </pre>
coverTable :: Testable prop => String -> [(String, Double)] -> prop -> Property

-- | Discards the test case if it does not complete within the given number
--   of microseconds. This can be useful when testing algorithms that have
--   pathological cases where they run extremely slowly.
discardAfter :: Testable prop => Int -> prop -> Property

-- | Like <a>forAll</a>, but with an explicitly given show function.
forAllShow :: Testable prop => Gen a -> (a -> String) -> (a -> prop) -> Property

-- | Like <a>forAll</a>, but without printing the generated value.
forAllBlind :: Testable prop => Gen a -> (a -> prop) -> Property

-- | Like <a>forAllShrink</a>, but with an explicitly given show function.
forAllShrinkShow :: Testable prop => Gen a -> (a -> [a]) -> (a -> String) -> (a -> prop) -> Property

-- | Like <a>forAllShrink</a>, but without printing the generated value.
forAllShrinkBlind :: Testable prop => Gen a -> (a -> [a]) -> (a -> prop) -> Property

-- | Like <a>/=</a>, but prints a counterexample when it fails.
(=/=) :: (Eq a, Show a) => a -> a -> Property
infix 4 =/=

-- | Checks that a value is total, i.e., doesn't crash when evaluated.
total :: NFData a => a -> Property

-- | Check if the test run result was a success
isSuccess :: Result -> Bool

-- | The default test arguments
stdArgs :: Args

-- | Tests a property and prints the results and all test cases generated
--   to <tt>stdout</tt>. This is just a convenience function that means the
--   same as <tt><a>quickCheck</a> . <a>verbose</a></tt>.
--   
--   Note: for technical reasons, the test case is printed out <i>after</i>
--   the property is tested. To debug a property that goes into an infinite
--   loop, use <a>within</a> to add a timeout instead.
verboseCheck :: Testable prop => prop -> IO ()

-- | Tests a property, using test arguments, and prints the results and all
--   test cases generated to <tt>stdout</tt>. This is just a convenience
--   function that combines <a>quickCheckWith</a> and <a>verbose</a>.
--   
--   Note: for technical reasons, the test case is printed out <i>after</i>
--   the property is tested. To debug a property that goes into an infinite
--   loop, use <a>within</a> to add a timeout instead.
verboseCheckWith :: Testable prop => Args -> prop -> IO ()

-- | Tests a property, produces a test result, and prints the results and
--   all test cases generated to <tt>stdout</tt>. This is just a
--   convenience function that combines <a>quickCheckResult</a> and
--   <a>verbose</a>.
--   
--   Note: for technical reasons, the test case is printed out <i>after</i>
--   the property is tested. To debug a property that goes into an infinite
--   loop, use <a>within</a> to add a timeout instead.
verboseCheckResult :: Testable prop => prop -> IO Result

-- | Tests a property, using test arguments, produces a test result, and
--   prints the results and all test cases generated to <tt>stdout</tt>.
--   This is just a convenience function that combines
--   <a>quickCheckWithResult</a> and <a>verbose</a>.
--   
--   Note: for technical reasons, the test case is printed out <i>after</i>
--   the property is tested. To debug a property that goes into an infinite
--   loop, use <a>within</a> to add a timeout instead.
verboseCheckWithResult :: Testable prop => Args -> prop -> IO Result

-- | Test a polymorphic property, defaulting all type variables to
--   <a>Integer</a>.
--   
--   Invoke as <tt>$(<a>polyQuickCheck</a> 'prop)</tt>, where <tt>prop</tt>
--   is a property. Note that just evaluating <tt><a>quickCheck</a>
--   prop</tt> in GHCi will seem to work, but will silently default all
--   type variables to <tt>()</tt>!
--   
--   <tt>$(<a>polyQuickCheck</a> 'prop)</tt> means the same as
--   <tt><a>quickCheck</a> $(<a>monomorphic</a> 'prop)</tt>. If you want to
--   supply custom arguments to <a>polyQuickCheck</a>, you will have to
--   combine <a>quickCheckWith</a> and <a>monomorphic</a> yourself.
--   
--   If you want to use <a>polyQuickCheck</a> in the same file where you
--   defined the property, the same scoping problems pop up as in
--   <a>quickCheckAll</a>: see the note there about <tt>return []</tt>.
polyQuickCheck :: Name -> ExpQ

-- | Test a polymorphic property, defaulting all type variables to
--   <a>Integer</a>. This is just a convenience function that combines
--   <a>verboseCheck</a> and <a>monomorphic</a>.
--   
--   If you want to use <a>polyVerboseCheck</a> in the same file where you
--   defined the property, the same scoping problems pop up as in
--   <a>quickCheckAll</a>: see the note there about <tt>return []</tt>.
polyVerboseCheck :: Name -> ExpQ

-- | Monomorphise an arbitrary property by defaulting all type variables to
--   <a>Integer</a>.
--   
--   For example, if <tt>f</tt> has type <tt><a>Ord</a> a =&gt; [a] -&gt;
--   [a]</tt> then <tt>$(<a>monomorphic</a> 'f)</tt> has type
--   <tt>[<a>Integer</a>] -&gt; [<a>Integer</a>]</tt>.
--   
--   If you want to use <a>monomorphic</a> in the same file where you
--   defined the property, the same scoping problems pop up as in
--   <a>quickCheckAll</a>: see the note there about <tt>return []</tt>.
monomorphic :: Name -> ExpQ

-- | Test all properties in the current module, using a custom
--   <a>quickCheck</a> function. The same caveats as with
--   <a>quickCheckAll</a> apply.
--   
--   <tt>$<a>forAllProperties</a></tt> has type <tt>(<a>Property</a> -&gt;
--   <a>IO</a> <a>Result</a>) -&gt; <a>IO</a> <a>Bool</a></tt>. An example
--   invocation is <tt>$<a>forAllProperties</a>
--   <a>quickCheckResult</a></tt>, which does the same thing as
--   <tt>$<a>quickCheckAll</a></tt>.
--   
--   <a>forAllProperties</a> has the same issue with scoping as
--   <a>quickCheckAll</a>: see the note there about <tt>return []</tt>.
forAllProperties :: Q Exp

-- | List all properties in the current module.
--   
--   <tt>$<a>allProperties</a></tt> has type <tt>[(<a>String</a>,
--   <a>Property</a>)]</tt>.
--   
--   <a>allProperties</a> has the same issue with scoping as
--   <a>quickCheckAll</a>: see the note there about <tt>return []</tt>.
allProperties :: Q Exp

-- | Test all properties in the current module. The name of the property
--   must begin with <tt>prop_</tt>. Polymorphic properties will be
--   defaulted to <a>Integer</a>. Returns <a>True</a> if all tests
--   succeeded, <a>False</a> otherwise.
--   
--   To use <a>quickCheckAll</a>, add a definition to your module along the
--   lines of
--   
--   <pre>
--   return []
--   runTests = $quickCheckAll
--   </pre>
--   
--   and then execute <tt>runTests</tt>.
--   
--   Note: the bizarre <tt>return []</tt> in the example above is needed on
--   GHC 7.8 and later; without it, <a>quickCheckAll</a> will not be able
--   to find any of the properties. For the curious, the <tt>return []</tt>
--   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 <tt>return []</tt> before it starts on the rest of the
--   module, which means that the later call to <a>quickCheckAll</a> can
--   see everything that was defined before the <tt>return []</tt>. Yikes!
quickCheckAll :: Q Exp

-- | Test all properties in the current module. This is just a convenience
--   function that combines <a>quickCheckAll</a> and <a>verbose</a>.
--   
--   <a>verboseCheckAll</a> has the same issue with scoping as
--   <a>quickCheckAll</a>: see the note there about <tt>return []</tt>.
verboseCheckAll :: Q Exp

-- | Given a property, which must use <a>label</a>, <a>collect</a>,
--   <a>classify</a> or <a>cover</a> to associate labels with test cases,
--   find an example test case for each possible label. The example test
--   cases are minimised using shrinking.
--   
--   For example, suppose we test <tt><a>delete</a> x xs</tt> and record
--   the number of times that <tt>x</tt> occurs in <tt>xs</tt>:
--   
--   <pre>
--   prop_delete :: Int -&gt; [Int] -&gt; Property
--   prop_delete x xs =
--     classify (count x xs == 0) "count x xs == 0" $
--     classify (count x xs == 1) "count x xs == 1" $
--     classify (count x xs &gt;= 2) "count x xs &gt;= 2" $
--     counterexample (show (delete x xs)) $
--     count x (delete x xs) == max 0 (count x xs-1)
--     where count x xs = length (filter (== x) xs)
--   </pre>
--   
--   <a>labelledExamples</a> generates three example test cases, one for
--   each label:
--   
--   <pre>
--   &gt;&gt;&gt; labelledExamples prop_delete
--   *** Found example of count x xs == 0
--   0
--   []
--   []
--   
--   *** Found example of count x xs == 1
--   0
--   [0]
--   []
--   
--   *** Found example of count x xs &gt;= 2
--   5
--   [5,5]
--   [5]
--   
--   +++ OK, passed 100 tests:
--   78% count x xs == 0
--   21% count x xs == 1
--    1% count x xs &gt;= 2
--   </pre>
labelledExamples :: Testable prop => prop -> IO ()

-- | A variant of <a>labelledExamples</a> that takes test arguments.
labelledExamplesWith :: Testable prop => Args -> prop -> IO ()

-- | A variant of <a>labelledExamples</a> that returns a result.
labelledExamplesResult :: Testable prop => prop -> IO Result

-- | A variant of <a>labelledExamples</a> that takes test arguments and
--   returns a result.
labelledExamplesWithResult :: Testable prop => Args -> prop -> IO Result
instance Test.QuickCheck.Safe.STestable Test.QuickCheck.Safe.SProperty
instance Test.QuickCheck.Safe.STestable prop => Test.QuickCheck.Safe.STestable (Test.QuickCheck.Gen.Gen prop)
instance Test.QuickCheck.Safe.STestable GHC.Types.Bool
instance (Test.QuickCheck.Arbitrary.Arbitrary a, GHC.Show.Show a, Test.QuickCheck.Safe.STestable prop) => Test.QuickCheck.Safe.STestable (a -> prop)
