registry-hedgehog- utilities to work with Hedgehog generators and `registry`

Safe HaskellNone




type GenIO = GenT IO Source #

All the generators we use are lifted into GenIO to allow some generators to be stateful

data Chooser Source #

A "chooser" strategy The type can be used to debug specializations




Show Chooser Source # 
Instance details

Defined in Data.Registry.Internal.Hedgehog

cycleWith :: MonadIO m => IORef Int -> [GenT m a] -> IO (GenT m a) Source #

Pick a generator in a list based on the previous position selected

chooseOne :: GenIO Chooser -> [GenIO a] -> GenIO a Source #

Given a choosing strategy pick a generator This is possibly a stateful operation

choiceChooser :: Chooser Source #

Chooser for randomly selecting a generator

cycleChooser :: IO Chooser Source #

Chooser for deterministically choosing elements in a list by cycling over them, which requires to maintain some state about the last position

distinct :: (MonadIO m, Eq a) => GenT m a -> IO (GenT m a) Source #

Create a generator for distinct values This is a stateful operation

distinctWith :: (MonadIO m, Eq a) => IORef [a] -> GenT m a -> GenT m a Source #

Generate distinct values based on the values already generated

liftGen :: Monad m => Gen a -> GenT m a Source #

Lift a pure generator into another monad like IO

sampleIO :: GenIO a -> IO a Source #

Sample GenIO values