mirror of
https://github.com/HuwCampbell/grenade.git
synced 2024-11-23 09:22:11 +03:00
6c6e706e66
This is a bit ironic, as the Typable constraint only exists for 7.10 printing in hedgehog, but the 7.10 proxies don't have typeable.
23 lines
668 B
Haskell
23 lines
668 B
Haskell
{-# LANGUAGE RankNTypes #-}
|
|
module Test.Jack.Compat where
|
|
|
|
import Control.Monad.Trans.Class (MonadTrans(..))
|
|
|
|
import Hedgehog
|
|
import qualified Hedgehog.Gen as Gen
|
|
import qualified Hedgehog.Range as Range
|
|
import Hedgehog.Internal.Property ( Test (..) )
|
|
|
|
type Jack x = forall m. Monad m => Gen m x
|
|
|
|
(...) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
|
|
(...) = (.) . (.)
|
|
{-# INLINE (...) #-}
|
|
|
|
choose :: Integral a => a -> a -> Jack a
|
|
choose = Gen.integral ... Range.constant
|
|
|
|
-- | Generates a random input for the test by running the provided generator.
|
|
blindForAll :: Monad m => Gen m a -> Test m a
|
|
blindForAll = Test . lift . lift
|