Hoogle Search

Within LTS Haskell 24.26 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. newtype GenericArbitraryUG (genList :: k) a

    generic-random Generic.Random

    GenericArbitraryU with explicit generators. See also GenericArbitraryG. This newtype does no shrinking. To add generic shrinking, use AndShrinking. Uses genericArbitraryUG.

  2. GenericArbitraryUG :: a -> GenericArbitraryUG (genList :: k) a

    generic-random Generic.Random

    No documentation available.

  3. newtype GenericArbitraryWith (opts :: k) (weights :: k1) a

    generic-random Generic.Random

    General generic generator with custom options. This newtype does no shrinking. To add generic shrinking, use AndShrinking. Uses genericArbitraryWith.

  4. GenericArbitraryWith :: a -> GenericArbitraryWith (opts :: k) (weights :: k1) a

    generic-random Generic.Random

    No documentation available.

  5. genericArbitrary :: GArbitrary UnsizedOpts a => Weights a -> Gen a

    generic-random Generic.Random

    Pick a constructor with a given distribution, and fill its fields with recursive calls to arbitrary.

    Example

    genericArbitrary (2 % 3 % 5 % ()) :: Gen a
    
    Picks the first constructor with probability 2/10, the second with probability 3/10, the third with probability 5/10.

  6. genericArbitrary' :: (GArbitrary SizedOptsDef a, BaseCase a) => Weights a -> Gen a

    generic-random Generic.Random

    Decrease size to ensure termination for recursive types, looking for base cases once the size reaches 0.

    genericArbitrary' (17 % 19 % 23 % ()) :: Gen a
    
    N.B.: This replaces the generator for fields of type [t] with listOf' arbitrary instead of listOf arbitrary (i.e., arbitrary for lists).

  7. genericArbitraryG :: GArbitrary (SetGens genList UnsizedOpts) a => genList -> Weights a -> Gen a

    generic-random Generic.Random

    genericArbitrary with explicit generators.

    Example

    genericArbitraryG customGens (17 % 19 % ())
    
    where, the generators for String and Int fields are overridden as follows, for example:
    customGens :: Gen String :+ Gen Int
    customGens =
    (filter (/= 'NUL') <$> arbitrary) :+
    (getNonNegative <$> arbitrary)
    

    Note on multiple matches

    Multiple generators may match a given field: the first will be chosen.

  8. genericArbitraryRec :: GArbitrary SizedOptsDef a => Weights a -> Gen a

    generic-random Generic.Random

    Decrease size at every recursive call, but don't do anything different at size 0.

    genericArbitraryRec (7 % 11 % 13 % ()) :: Gen a
    
    N.B.: This replaces the generator for fields of type [t] with listOf' arbitrary instead of listOf arbitrary (i.e., arbitrary for lists).

  9. genericArbitraryRecG :: GArbitrary (SetGens genList SizedOpts) a => genList -> Weights a -> Gen a

    generic-random Generic.Random

    genericArbitraryRec with explicit generators. See also genericArbitraryG.

  10. genericArbitrarySingle :: forall a (c0 :: Symbol) . (GArbitrary UnsizedOpts a, Weights_ (Rep a) ~ L c0) => Gen a

    generic-random Generic.Random

    arbitrary for types with one constructor. Equivalent to genericArbitraryU, with a stricter type.

    genericArbitrarySingle :: Gen a
    

Page 53 of many | Previous | Next