testing-feat-0.1: Functional enumeration for systematic and random testing

Safe HaskellNone

Test.Feat.Enumerate

Contents

Description

Basic combinators fo building enumerations most users will want to use the type class based combinators in Test.Feat.Class instead.

Synopsis

Documentation

data Enumerate a Source

A functional enumeration of type t is a partition of t into finite numbered sets called Parts. The number that identifies each part is called the cost of the values in that part.

Constructors

Enumerate 

Fields

card :: Part -> Index

Computes the cardinality of a given part.

select :: Part -> Index -> a

Selects a value from the enumeration For select e p i, i should be less than card e p

optimal :: Sharing Tag (Enumerate a)

A self-optimising function.

Instances

Functor Enumerate

Only use fmap with bijective functions (e.g. data constructors)

Typeable1 Enumerate 
Applicative Enumerate

* corresponds to product (as with lists)

Monoid (Enumerate a)

mappend = union

Combinators for building enumerations

pay :: Enumerate a -> Enumerate aSource

Increases the cost of all values in an enumeration by one.

Memoisation

mempay :: Enumerate a -> Enumerate aSource

A conventient combination of memoisation and guarded recursion.

Polymorphic memoisation

data Tag Source

Constructors

Source String String Int Int 

Instances