compdata-0.2: Compositional Data Types

Portabilitynon-portable (GHC Extensions)
Stabilityexperimental
MaintainerPatrick Bahr <paba@diku.dk>

Data.Comp.Arbitrary

Description

This module defines generation of arbitrary values for signatures, which lifts to generating arbitrary terms.

Synopsis

Documentation

class ArbitraryF f whereSource

Signature arbitration. An instance ArbitraryF f gives rise to an instance Arbitrary (Term f).

Methods

arbitraryF' :: Arbitrary v => [(Int, Gen (f v))]Source

arbitraryF :: Arbitrary v => Gen (f v)Source

shrinkF :: Arbitrary v => f v -> [f v]Source

Instances

ArbitraryF [] 
ArbitraryF Maybe 
Arbitrary b[13] => ArbitraryF ((,) b[13]) 
ArbitraryF f => ArbitraryF (Context f)

This lifts instances of ArbitraryF to instances of ArbitraryF for the corresponding context functor.

(Arbitrary b[13], Arbitrary c[14]) => ArbitraryF ((,,) b[13] c[14]) 
(ArbitraryF f, Arbitrary p) => ArbitraryF (:&: f p) 
(ArbitraryF f, ArbitraryF g) => ArbitraryF (:+: f g)

Instances of ArbitraryF are closed under forming sums.

(Arbitrary b[13], Arbitrary c[14], Arbitrary d[15]) => ArbitraryF ((,,,) b[13] c[14] d[15]) 
(Arbitrary b[13], Arbitrary c[14], Arbitrary d[15], Arbitrary e[16]) => ArbitraryF ((,,,,) b[13] c[14] d[15] e[16]) 
(Arbitrary b[13], Arbitrary c[14], Arbitrary d[15], Arbitrary e[16], Arbitrary f[17]) => ArbitraryF ((,,,,,) b[13] c[14] d[15] e[16] f[17]) 
(Arbitrary b[13], Arbitrary c[14], Arbitrary d[15], Arbitrary e[16], Arbitrary f[17], Arbitrary g[18]) => ArbitraryF ((,,,,,,) b[13] c[14] d[15] e[16] f[17] g[18]) 
(Arbitrary b[13], Arbitrary c[14], Arbitrary d[15], Arbitrary e[16], Arbitrary f[17], Arbitrary g[18], Arbitrary h[19]) => ArbitraryF ((,,,,,,,) b[13] c[14] d[15] e[16] f[17] g[18] h[19]) 
(Arbitrary b[13], Arbitrary c[14], Arbitrary d[15], Arbitrary e[16], Arbitrary f[17], Arbitrary g[18], Arbitrary h[19], Arbitrary i[1a]) => ArbitraryF ((,,,,,,,,) b[13] c[14] d[15] e[16] f[17] g[18] h[19] i[1a]) 
(Arbitrary b[13], Arbitrary c[14], Arbitrary d[15], Arbitrary e[16], Arbitrary f[17], Arbitrary g[18], Arbitrary h[19], Arbitrary i[1a], Arbitrary j[1b]) => ArbitraryF ((,,,,,,,,,) b[13] c[14] d[15] e[16] f[17] g[18] h[19] i[1a] j[1b])