StrictCheck-0.3.0: StrictCheck: Keep Your Laziness In Check

Safe HaskellNone
LanguageHaskell2010

Test.StrictCheck.Internal.Inputs

Description

Internal module: This module does not make any stability guarantees, and may not adhere to the PVP.

This module implements the rose-tree data structure used by StrictCheck to monomorphize inputs to functions. We decouple the consumption of input from the production of output by converting any input to an Input: a lazily constructed rose tree with nodes each containing a (Gen a -> Gen a) which captures a random perturbation associated with the shape of the value consumed. The tree-shape of an Input matches that of the entire consumed value, and evaluating any subpart of it forces the evaluation of the corresponding part of the original value.

Synopsis

Documentation

newtype Variant Source #

A variant which can be applied to any generator--kept in a newtype to get around lack of impredicativity.

Constructors

Variant 

Fields

data Input Source #

A tree representing all possible destruction sequences for a value Unfolding the contained lists forces a particular random control path for destructing the datatype.

Constructors

Input Variant [Input]

Not exposed in safe API

newtype Inputs Source #

A list of inputs given to a function, in abstract form. This lazy structure is evaluated piecewise during the course of producing a function, thus triggering the partial evaluation of the original input to the function.

Constructors

Inputs [Input]

Not exposed in safe API

draw :: Input -> (Variant, [Input]) Source #

Extract the entropy and subfield-Inputs from a given Input

destruct :: Inputs -> [Input] Source #

Extract the list of Inputs from an Inputs