quickcheck-arbitrary-template-0.2.1.0: Generate QuickCheck Gen for Sum Types

Safe HaskellNone
LanguageHaskell2010

Test.QuickCheck.TH.Generators.Internal.BuildArbitrary

Synopsis

Documentation

buildArbAny :: Int -> Q [Dec] Source #

automatically build functions named buildArbn where n is an integer greater than 0. $(buildArbAny 3) creates a function buildArb3 which takes a constructor that takes 3 parameters, and returns an arbitrary instances of that constructor. It assumes that the constructors type is an instance of Arbitrary.

buildArb1 :: Arbitrary a => (a -> b) -> Gen b buildArb1 f = f $ arbitrary

buildArb2 :: (Arbitrary a, Arbitrary a1) => (a1 -> a -> b) -> Gen b buildArb2 f = f $ arbitrary * arbitrary