Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- type GenIO = GenT IO
- data Chooser = Chooser {}
- cycleWith :: MonadIO m => IORef Int -> [GenT m a] -> IO (GenT m a)
- chooseOne :: GenIO Chooser -> [GenIO a] -> GenIO a
- choiceChooser :: Chooser
- cycleChooser :: IO Chooser
- distinct :: (MonadIO m, Eq a) => GenT m a -> IO (GenT m a)
- distinctWith :: (MonadIO m, Eq a) => IORef [a] -> GenT m a -> GenT m a
- sampleIO :: GenIO a -> IO a

# Documentation

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

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

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