-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A GenT monad transformer for QuickCheck library. -- -- A GenT monad transformer for QuickCheck library. @package QuickCheck-GenT @version 0.1.3 -- | Most of the code is borrowed from a mailing list discussion. -- Therefor, credits go to Paul Johnson and Felix Martini. module QuickCheck.GenT newtype GenT m a GenT :: (StdGen -> Int -> m a) -> GenT m a unGenT :: GenT m a -> StdGen -> Int -> m a runGenT :: GenT m a -> Gen (m a) class (Applicative g, Monad g) => MonadGen g liftGen :: MonadGen g => Gen a -> g a variant :: (MonadGen g, Integral n) => n -> g a -> g a sized :: MonadGen g => (Int -> g a) -> g a resize :: MonadGen g => Int -> g a -> g a choose :: (MonadGen g, Random a) => (a, a) -> g a -- | Private variant-generating function. Converts an integer into a chain -- of (fst . split) and (snd . split) applications. Every integer -- (including negative ones) will give rise to a different random number -- generator in log2 n steps. var :: Integral n => n -> StdGen -> StdGen -- | Generates a value that satisfies a predicate. suchThat :: MonadGen m => m a -> (a -> Bool) -> m a -- | Tries to generate a value that satisfies a predicate. suchThatMaybe :: MonadGen m => m a -> (a -> Bool) -> m (Maybe a) -- | Generates a list of random length. The maximum length depends on the -- size parameter. listOf :: MonadGen m => m a -> m [a] -- | Generates a non-empty list of random length. The maximum length -- depends on the size parameter. listOf1 :: MonadGen m => m a -> m [a] -- | Generates a list of the given length. vectorOf :: MonadGen m => Int -> m a -> m [a] -- | Randomly uses one of the given generators. The input list must be -- non-empty. oneof :: MonadGen m => [m a] -> m a -- | Chooses one of the given generators, with a weighted random -- distribution. The input list must be non-empty. frequency :: MonadGen m => [(Int, m a)] -> m a -- | Generates one of the given values. The input list must be non-empty. elements :: MonadGen m => [a] -> m 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 :: MonadGen m => [a] -> m a -- | Randomly uses one of the given generators. oneofMay :: MonadGen m => [m a] -> m (Maybe a) -- | Generates one of the given values. elementsMay :: MonadGen m => [a] -> m (Maybe 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. growingElementsMay :: MonadGen m => [a] -> m (Maybe a) instance MonadGen Gen instance (Applicative m, Monad m) => MonadGen (GenT m) instance MonadIO m => MonadIO (GenT m) instance MonadTrans GenT instance (Functor m, Monad m) => Applicative (GenT m) instance Monad m => Monad (GenT m) instance Functor m => Functor (GenT m)