Copyright | (c) Donnacha Oisín Kidney 2021 |
---|---|
Maintainer | mail@doisinkidney.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Some utility functions for implementing Arbitrary
etc.
Documentation
>>>
import Test.QuickCheck
sumsTo :: Int -> Gen [Int] Source #
generates a list that sums to sumsTo
nn
.
n >= 0 ==> forAll (sumsTo n) (\xs -> sum xs === n)
percentageChance :: Word -> Gen Bool Source #
is percentageChance
nTrue
n
% of the time, and False
the rest
of the time.
percentageChanceIO :: Word -> IO Bool Source #
is percentageChanceIO
nTrue
n
% of the time, and False
the rest
of the time.