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.

  1. genericCoarbitrary :: (Generic a, GCoArbitrary (Rep a)) => a -> Gen b -> Gen b

    QuickCheck Test.QuickCheck

    Generic CoArbitrary implementation.

  2. liftArbitrary :: Arbitrary1 f => Gen a -> Gen (f a)

    QuickCheck Test.QuickCheck

    No documentation available.

  3. liftArbitrary2 :: Arbitrary2 f => Gen a -> Gen b -> Gen (f a b)

    QuickCheck Test.QuickCheck

    No documentation available.

  4. class CoArbitrary a

    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).

  5. applyArbitrary2 :: (Arbitrary a, Arbitrary b) => (a -> b -> r) -> Gen r

    QuickCheck Test.QuickCheck.Arbitrary

    Apply a binary function to random arguments.

  6. applyArbitrary3 :: (Arbitrary a, Arbitrary b, Arbitrary c) => (a -> b -> c -> r) -> Gen r

    QuickCheck Test.QuickCheck.Arbitrary

    Apply a ternary function to random arguments.

  7. applyArbitrary4 :: (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => (a -> b -> c -> d -> r) -> Gen r

    QuickCheck Test.QuickCheck.Arbitrary

    Apply a function of arity 4 to random arguments.

  8. coarbitrary :: CoArbitrary a => a -> Gen b -> Gen b

    QuickCheck 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)
    

  9. coarbitraryEnum :: Enum a => a -> Gen b -> Gen b

    QuickCheck Test.QuickCheck.Arbitrary

    A coarbitrary implementation for enums.

  10. coarbitraryIntegral :: Integral a => a -> Gen b -> Gen b

    QuickCheck Test.QuickCheck.Arbitrary

    A coarbitrary implementation for integral numbers.

Page 27 of many | Previous | Next