HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletesting-feat-1.1.1.1Haskell2010

Test.Feat.Access

Functions for accessing the values of enumerations including compatibility with the property based testing framework QuickCheck

  • 12 values

Accessing functions

4 declarations
valueoptimal :: Enumerable a => Enumerate a
#

Memoised enumeration. Note that all cardinalities are kept in memory until your program terminates.

valueindex :: Enumerable a => Integer -> a
#

Index into an enumeration. Mainly used for party tricks (give it a really large number), since usually you want to distinguish values by size.

valueselect :: Enumerable a => Int -> Index -> a
#

A more fine grained version of index that takes a size and an index into the values of that size. select p i is only defined for i within bounds (meaning i < fst (values !! p)).

valuevalues :: Enumerable a => [(Integer, [a])]
#

All values of the enumeration by increasing cost (which is the number of constructors for most types). Also contains the length of each list.

QuickCheck Compatibility

1 declaration
valueuniform :: Enumerable a => Int -> Gen a
#

Compatibility with QuickCheck. Distribution is uniform generator over values bounded by the given size. Typical use: sized uniform.

Combinators

3 declarations
valueskipping :: Enumerate a -> Index -> Integer -> Enumerate a
#

Enumerates every nth value of the enumeration from a given starting index. As a special case striped 0 1 gives all values (starts at index 0 and takes steps of 1).

Useful for running enumerations in parallel since e.g. striped 0 2 is disjoint from striped 1 2 and the union of the two cover all values.

valuebounded :: Enumerate a -> Integer -> Enumerate a
#

A version of values with a limited number of values in each inner list. If the list corresponds to a Part which is larger than the bound it evenly distributes the values across the enumeration of the Part.

Non-class versions of the access functions

4 declarations