Module Arbitrary

This module is undocumented. This is a list of its definitions.

Gen :: (Integer -> <Random> a) -> Gen a
arbitrary :: Arbitrary a => Gen a

The default generator of the type.

arbitraryEither :: Gen a -> Gen b -> Gen (Either a b)

A generator that produces with equal probability either a Left or a Right value of the corresponding generator.

arbitraryElement :: [a] -> Gen a

A generator that picks one element of the given list with equal probability. Fails if the list is empty.

arbitraryFixedSizeList :: Integer -> Gen a -> Gen [a]

arbitraryFixedSizeList n gen is a generator of lists of exactly n elements produced by gen.

arbitraryFixedSizeVector :: VecComp a => Integer -> Gen a -> Gen (Vector a)

arbitraryFixedSizeVector n gen is a generator of vectors of exactly n elements produced by gen.

arbitraryIdentifier :: Gen String

Generates a random string that is a valid SCL or Java identifier

arbitraryList :: Gen a -> Gen [a]

A generator of lists of elements produced by the given generator. The length is chosen randomly below the size hint.

arbitraryMaybe :: Gen a -> Gen (Maybe a)

A generator that produces Nothing with probability 1/4 and otherwise Just a value of the given generator.

arbitraryResized :: (Integer -> Integer) -> Gen a -> Gen a

arbitraryResized f gen is gen with the size hint n replaced by f n.

arbitraryTuple2 :: Gen a -> Gen b -> Gen (a, b)

A generator of pairs whose components are produced by the two given generators.

arbitraryTuple3 :: Gen a -> Gen b -> Gen c -> Gen (a, b, c)

A generator of 3-tuples whose components are produced by the given generators.

arbitraryTuple4 :: Gen a -> Gen b -> Gen c -> Gen d -> Gen (a, b, c, d)

A generator of 4-tuples whose components are produced by the given generators.

arbitraryTuple5 :: Gen a -> Gen b -> Gen c -> Gen d -> Gen e -> Gen (a, b, c, d, e)

A generator of 5-tuples whose components are produced by the given generators.

arbitraryTuple6 :: Gen a -> Gen b -> Gen c -> Gen d -> Gen e -> Gen f -> Gen (a, b, c, d, e, f)

A generator of 6-tuples whose components are produced by the given generators.

arbitraryVector :: VecComp a => Gen a -> Gen (Vector a)

A generator of vectors of elements produced by the given generator. The length is chosen randomly below the size hint.

genRandom :: <Random> a -> Gen a

A generator that produces its value with the given random expression, ignoring the size hint.

randomCharacter :: <Random> Character

A random character. Space and the printable ASCII characters are the most likely results.

randomIdentifierCharacter :: <Random> Character

A random ASCII letter or digit, i.e. a character that can continue an SCL or Java identifier.

randomIdentifierFirstCharacter :: <Random> Character

A random ASCII letter, i.e. a character that can start an SCL or Java identifier.

runGen :: Gen a -> Integer -> <Random> a

runGen gen n produces one value with the generator gen using n as the size hint.

variateSeed :: CoArbitrary a => Integer -> Long -> a -> Long

variateSeed size seed value mixes the given value into the given seed.