Module

Test.QuickCheck.Arbitrary

Package
quickcheck
Repository
purerl/purescript-quickcheck

#Arbitrary Source

class Arbitrary t  where

The Arbitrary class represents those types whose values can be randomly-generated.

arbitrary uses the Gen monad to express a random generator for the type t. Combinators in the Test.QuickCheck.Gen module can be used to construct random generators.

Members

Instances

#Coarbitrary Source

class Coarbitrary t  where

The Coarbitrary class represents types which appear on the left of an Arbitrary function arrow.

To construct an Arbitrary instance for the type a -> b, we need to use the input of type a to perturb a random generator for b. This is the role of the coarbitrary function.

Coarbitrary instances can be written using the perturbGen function.

Members

Instances

#genericArbitrary Source

genericArbitrary :: forall a rep. Generic a rep => Arbitrary rep => Gen a

A Generic implementation of the arbitrary member from the Arbitrary type class.

#genericCoarbitrary Source

genericCoarbitrary :: forall a rep t. Generic a rep => Coarbitrary rep => a -> Gen t -> Gen t

A Generic implementation of the coarbitrary member from the Coarbitrary type class.

#ArbitraryGenericSum Source

class ArbitraryGenericSum t  where

To be able to evenly distribute over chains of Sum types we build up a collection of generators and choose between. Each right component of a Sum is either a Constructor or another Sum.

Members

Instances

#ArbitraryRowList Source

class ArbitraryRowList :: RowList Type -> Row Type -> Constraintclass ArbitraryRowList list row | list -> row where

Members

Instances