QuickCheck-safe-0.1.0.6: Safe reimplementation of QuickCheck's core

Safe Haskell | Trustworthy
Language | Haskell2010

Test.QuickCheck.Safe.Trusted

Synopsis

- pureEvaluate :: a -> Either AnException a
- type AnException = SomeException
- inventQCGen :: a -> QCGen
- data QCGen

# Documentation

pureEvaluate :: a -> Either AnException a Source #

`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.

type AnException = SomeException Source #

inventQCGen :: a -> QCGen Source #

`inventQCGen` invokes `newQCGen` via `unsafePerformIO`. It is useful in connection with the `quickCheck` family of functions.

data QCGen Source #

The "standard" QuickCheck random number generator. A wrapper around either `SMGen` on GHC, or `StdGen` on other Haskell systems.

#### Instances

Instances details

Arbitrary QCGen |
Instance details Defined in Test.QuickCheck.Arbitrary Methods arbitrary :: Gen QCGen Source # shrink :: QCGen -> [QCGen] Source #
Splittable QCGen |
Instance details Defined in Test.QuickCheck.Random Methods left :: QCGen -> QCGen right :: QCGen -> QCGen
Read QCGen |
Instance details Defined in Test.QuickCheck.Random Methods readsPrec :: Int -> ReadS QCGen Source # readList :: ReadS [QCGen] Source # readPrec :: ReadPrec QCGen Source # readListPrec :: ReadPrec [QCGen] Source #
Show QCGen |
Instance details Defined in Test.QuickCheck.Random Methods showsPrec :: Int -> QCGen -> ShowS Source # show :: QCGen -> String Source # showList :: [QCGen] -> ShowS Source #
RandomGen QCGen |

Instance details

Defined in Test.QuickCheck.Random

Methods

next :: QCGen -> (Int, QCGen)

genWord8 :: QCGen -> (Word8, QCGen)

genWord16 :: QCGen -> (Word16, QCGen)

genWord32 :: QCGen -> (Word32, QCGen)

genWord64 :: QCGen -> (Word64, QCGen)

genWord32R :: Word32 -> QCGen -> (Word32, QCGen)

genWord64R :: Word64 -> QCGen -> (Word64, QCGen)

genShortByteString :: Int -> QCGen -> (ShortByteString, QCGen)

genRange :: QCGen -> (Int, Int)

split :: QCGen -> (QCGen, QCGen)