{-# LANGUAGE CPP #-}
#ifndef NO_SAFE_HASKELL
{-# LANGUAGE Safe #-}
#endif
#ifndef NO_ST_MONAD
{-# LANGUAGE Rank2Types #-}
#endif
module Test.QuickCheck.Gen.Unsafe where
import Test.QuickCheck.Gen
import Control.Monad
import Control.Applicative
promote :: Monad m => m (Gen a) -> Gen (m a)
promote :: forall (m :: * -> *) a. Monad m => m (Gen a) -> Gen (m a)
promote m (Gen a)
m = ((Gen a -> a) -> m (Gen a) -> m a)
-> m (Gen a) -> (Gen a -> a) -> m a
forall a b c. (a -> b -> c) -> b -> a -> c
flip (Gen a -> a) -> m (Gen a) -> m a
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM m (Gen a)
m ((Gen a -> a) -> m a) -> Gen (Gen a -> a) -> Gen (m a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen (Gen a -> a)
forall a. Gen (Gen a -> a)
delay
delay :: Gen (Gen a -> a)
delay :: forall a. Gen (Gen a -> a)
delay = (QCGen -> Int -> Gen a -> a) -> Gen (Gen a -> a)
forall a. (QCGen -> Int -> a) -> Gen a
MkGen (\QCGen
r Int
n Gen a
g -> Gen a -> QCGen -> Int -> a
forall a. Gen a -> QCGen -> Int -> a
unGen Gen a
g QCGen
r Int
n)
#ifndef NO_ST_MONAD
capture :: Gen Capture
capture :: Gen Capture
capture = (QCGen -> Int -> Capture) -> Gen Capture
forall a. (QCGen -> Int -> a) -> Gen a
MkGen (\QCGen
r Int
n -> (forall a. Gen a -> a) -> Capture
Capture (\Gen a
g -> Gen a -> QCGen -> Int -> a
forall a. Gen a -> QCGen -> Int -> a
unGen Gen a
g QCGen
r Int
n))
newtype Capture = Capture (forall a. Gen a -> a)
#endif