HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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

Contents
  1. Accessing functions
  2. QuickCheck Compatibility
  3. Combinators
  4. Non-class versions of the access functions
Synopsis

Accessing functions

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

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

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