Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- errorMess ∷ HasCallStack ⇒ String → [String] → a
- suchThatErr ∷ [String] → Gen a → (a → Bool) → Gen a
- addUntilSize ∷ Ord a ⇒ [String] → Set a → Set a → Int → Gen (Set a)
- setSized ∷ Ord a ⇒ [String] → Int → Gen a → Gen (Set a)
- fixSet ∷ Ord a ⇒ [String] → Int → Int → Gen a → Set a → Gen (Set a)
- mapSized ∷ Ord a ⇒ [String] → Int → Gen a → Gen b → Gen (Map a b)
- coinSized ∷ Int → Gen Coin
- subsetFromSetWithSize ∷ Ord a ⇒ [String] → Set a → Int → Gen (Set a)
- mapFromSubset ∷ Ord a ⇒ [String] → Map a b → Int → Gen a → Gen b → Gen (Map a b)
- mapFromSet ∷ Ord a ⇒ Set a → Gen b → Gen (Map a b)
- itemFromSet ∷ [String] → Set a → Gen (a, Set a)
- mapFromRange ∷ ∀ a b. Ord a ⇒ [String] → [b] → Gen a → Gen (Map a b)
- mapFromProj ∷ Ord a ⇒ [b] → Gen a → (b → Gen c) → Gen (Map a c)
- mapFromDomRange ∷ Ord a ⇒ Set a → [b] → Map a b
- subsetSize ∷ Set a → Gen Int
- subsetFromSet ∷ Ord a ⇒ [String] → Set a → Gen (Set a)
- superSetFromSet ∷ Ord a ⇒ Gen a → Set a → Gen (Set a)
- superSetFromSetWithSize ∷ Ord a ⇒ [String] → Int → Gen a → Set a → Gen (Set a)
- superItemFromSet ∷ Ord a ⇒ Gen a → Set a → Gen a
- genFromMap ∷ [String] → Map k a → Gen (k, a)
- subMapFromMapWithSize ∷ Ord k ⇒ Int → Map k a → Gen (Map k a)
Documentation
errorMess ∷ HasCallStack ⇒ String → [String] → a Source #
Report a Gen-time error from the current message extra
and the
[messages] mess
describing the path to this call site.
suchThatErr ∷ [String] → Gen a → (a → Bool) → Gen a Source #
suchThat version that tracks Gen-time errors
addUntilSize ∷ Ord a ⇒ [String] → Set a → Set a → Int → Gen (Set a) Source #
add items from source
to base
until size n
is reached.
setSized ∷ Ord a ⇒ [String] → Int → Gen a → Gen (Set a) Source #
Generate a random set of a fixed size size
, use gen
to pick the elements.
fixSet ∷ Ord a ⇒ [String] → Int → Int → Gen a → Set a → Gen (Set a) Source #
Fix a a set source
that is supposed to have size
elements, but because of duplicates
may not. Fix it by adding random elements using genA
, not currently in the set. If after numTries
the set is still not fixed, report an error.
mapSized ∷ Ord a ⇒ [String] → Int → Gen a → Gen b → Gen (Map a b) Source #
Generate a random Map with a fixed size n
. use genA
to pick the
domain of the map, and genB
to pick the range.
subsetFromSetWithSize ∷ Ord a ⇒ [String] → Set a → Int → Gen (Set a) Source #
Generate a random subset of a set set
with a fixed size n
mapFromSubset ∷ Ord a ⇒ [String] → Map a b → Int → Gen a → Gen b → Gen (Map a b) Source #
Generate a larger map, from a smaller map subset
. The new larger map, should have all the
keys and values of the smaller map.
mapFromSet ∷ Ord a ⇒ Set a → Gen b → Gen (Map a b) Source #
Generate a map, from a set. The new map, should have all the
elements of set
in its keysSet.
itemFromSet ∷ [String] → Set a → Gen (a, Set a) Source #
Generate a random element from a set. Also return the set with that element removed
mapFromDomRange ∷ Ord a ⇒ Set a → [b] → Map a b Source #
Generate a Map from a set dom
and a list bs
. They should have the same size
but this is not checked. The result should have the properties (Map.keysSet result == dom)
and (Map.elems result == bs)
subsetSize ∷ Set a → Gen Int Source #
Generate an Int, that would be a valid size for a subset of a set s
it should return 0 or the size of the set infrequently.
subsetFromSet ∷ Ord a ⇒ [String] → Set a → Gen (Set a) Source #
Generate a random subset of a set set
superSetFromSet ∷ Ord a ⇒ Gen a → Set a → Gen (Set a) Source #
Generate a random superset of a set set
. Use genA
to pick random additional elements
superSetFromSetWithSize ∷ Ord a ⇒ [String] → Int → Gen a → Set a → Gen (Set a) Source #
Generate a random superset of a set set
with s fixed size n
.
Use genA
to pick random additional elements.