Hoogle Search
Within LTS Haskell 24.9 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
genericCoarbitrary :: (Generic a, GCoArbitrary (Rep a)) => a -> Gen b -> Gen bQuickCheck Test.QuickCheck Generic CoArbitrary implementation.
liftArbitrary :: Arbitrary1 f => Gen a -> Gen (f a)QuickCheck Test.QuickCheck No documentation available.
liftArbitrary2 :: Arbitrary2 f => Gen a -> Gen b -> Gen (f a b)QuickCheck Test.QuickCheck No documentation available.
-
QuickCheck Test.QuickCheck.Arbitrary Used for random generation of functions. You should consider using Fun instead, which can show the generated functions as strings. If you are using a recent GHC, there is a default definition of coarbitrary using genericCoarbitrary, so if your type has a Generic instance it's enough to say
instance CoArbitrary MyType
You should only use genericCoarbitrary for data types where equality is structural, i.e. if you can't have two different representations of the same value. An example where it's not safe is sets implemented using binary search trees: the same set can be represented as several different trees. Here you would have to explicitly define coarbitrary s = coarbitrary (toList s). applyArbitrary2 :: (Arbitrary a, Arbitrary b) => (a -> b -> r) -> Gen rQuickCheck Test.QuickCheck.Arbitrary Apply a binary function to random arguments.
applyArbitrary3 :: (Arbitrary a, Arbitrary b, Arbitrary c) => (a -> b -> c -> r) -> Gen rQuickCheck Test.QuickCheck.Arbitrary Apply a ternary function to random arguments.
-
QuickCheck Test.QuickCheck.Arbitrary Apply a function of arity 4 to random arguments.
coarbitrary :: CoArbitrary a => a -> Gen b -> Gen bQuickCheck Test.QuickCheck.Arbitrary Used to generate a function of type a -> b. The first argument is a value, the second a generator. You should use variant to perturb the random generator; the goal is that different values for the first argument will lead to different calls to variant. An example will help:
instance CoArbitrary a => CoArbitrary [a] where coarbitrary [] = variant 0 coarbitrary (x:xs) = variant 1 . coarbitrary (x,xs)
coarbitraryEnum :: Enum a => a -> Gen b -> Gen bQuickCheck Test.QuickCheck.Arbitrary A coarbitrary implementation for enums.
coarbitraryIntegral :: Integral a => a -> Gen b -> Gen bQuickCheck Test.QuickCheck.Arbitrary A coarbitrary implementation for integral numbers.