regular-extras-0.1.1: Additional functions for regular: arbitrary, coarbitrary, and binary get/put.

Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org

Generics.Regular.Functions.Arbitrary

Contents

Description

Summary: Generic Test.QuickCheck instances.

Synopsis

Generic arbitrary functionality

type FrequencyTable = [(String, Int)]Source

A frequency table detailing how often certain constructors should be picked. The String corresponds to the constructor name, as returned by conNames.

class Arbitrary f whereSource

Generic Arbitrary class

Methods

harbitrary :: (Int -> Gen a) -> FrequencyTable -> Int -> Int -> Maybe (Gen (f a))Source

Instances

Arbitrary I 
Arbitrary U 
Arbitrary a => Arbitrary (K a) 
(Fixpoints f, Fixpoints g, ConNames f, Arbitrary f, ConNames g, Arbitrary g) => Arbitrary (:+: f g) 
(Arbitrary f, Arbitrary g) => Arbitrary (:*: f g) 
(Arbitrary f, Constructor c) => Arbitrary (C c f) 

arbitraryWith :: (Regular a, Arbitrary (PF a)) => FrequencyTable -> Int -> Gen aSource

Generic arbitrary function, sized and with custom constructor frequencies.

arbitrary :: (Regular a, Arbitrary (PF a)) => Gen aSource

Generic arbitrary function with default sizes and constructor frequencies.

Generic coarbitrary functionality

class CoArbitrary f whereSource

Generic CoArbitrary class

Methods

hcoarbitrary :: (b -> Gen a -> Gen a) -> Int -> f b -> Gen a -> Gen aSource

corbitrary :: (Regular b, CoArbitrary (PF b)) => b -> Gen a -> Gen aSource

Generic coarbitrary function.