-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Safe reimplementation of QuickCheck's core -- @package QuickCheck-safe @version 0.1 module Test.QuickCheck.Safe.Trusted -- | pureEvaluate wraps tryEvaluate in -- unsafePerformIO. 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 -- | inventQCGen invokes newQCGen via unsafePerformIO. -- It is useful in connection with the quickCheck family of -- functions. inventQCGen :: a -> QCGen -- | The "standard" QuickCheck random number generator. A wrapper around -- either TFGen on GHC, or StdGen on other Haskell systems. data QCGen :: * -- | This module implements a simplified, pure version of Test.Quickcheck's -- quickCheck functionality. module Test.QuickCheck.Safe -- | Cf. quickCheck. Note that in contrast to QuickCheck's function, -- this one takes an additional QCGen argument. -- --
-- >>> putStr $ quickCheck (inventQCGen ()) (\x -> length (x :: [()]) < 10) -- *** Failed! Falsifiable (after 18 tests and 3 shrinks): -- [(),(),(),(),(),(),(),(),(),(),(),(),(),(),()] --quickCheck :: STestable prop => QCGen -> prop -> String -- | Cf. quickCheckResult. Note that in contrast to QuickCheck's -- function, this one takes an additional QCGen argument. quickCheckResult :: STestable prop => QCGen -> prop -> Result -- | Cf. quickCheckWith. Note that in contrast to QuickCheck's -- function, this one takes an additional QCGen argument. quickCheckWith :: STestable prop => Args -> QCGen -> prop -> String -- | Cf. quickCheckWithResult. Note that in contrast to QuickCheck's -- function, this one takes an additional QCGen argument. quickCheckWithResult :: STestable prop => Args -> QCGen -> prop -> Result class STestable prop -- | Implication. Cf. ==>. (==>) :: STestable prop => Bool -> prop -> SProperty -- | Disjunction. Cf. .||.. (.||.) :: (STestable prop2, STestable prop1) => prop1 -> prop2 -> SProperty -- | Conjunction. Cf. .&&.. (.&&.) :: (STestable prop2, STestable prop1) => prop1 -> prop2 -> SProperty -- | Nondeterministic conjunction. Cf. &.. (.&.) :: (STestable prop2, STestable prop1) => prop1 -> prop2 -> SProperty -- | Equality test. Cf. ===. (===) :: (Eq a, Show a) => a -> a -> SProperty -- | Label tests. Cf. label. label :: STestable prop => String -> prop -> SProperty -- | Shrink counterexamples. Cf. shrinking. shrinking :: STestable prop => (a -> [a]) -> a -> (a -> prop) -> SProperty -- | Suppress shrinking of counterexamples. Cf. noShrinking. noShrinking :: STestable prop => prop -> SProperty -- | Adjust testcase sizes. Cf. mapSize. mapSize :: STestable prop => (Int -> Int) -> prop -> SProperty -- | Universal quantification. Cf. forAll. forAll :: (Show a, STestable prop) => Gen a -> (a -> prop) -> SProperty -- | Universal quantification with shrinking. Cf. forAllShrink. forAllShrink :: (Show a, STestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> SProperty -- | inventQCGen invokes newQCGen via unsafePerformIO. -- It is useful in connection with the quickCheck family of -- functions. inventQCGen :: a -> QCGen instance [safe] (Arbitrary a, Show a, STestable prop) => STestable (a -> prop) instance [safe] STestable Bool instance [safe] STestable prop => STestable (Gen prop) instance [safe] STestable SProperty