Hoogle Search

Within LTS Haskell 24.32 (ghc-9.10.3)

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

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

    tasty-quickcheck Test.Tasty.QuickCheck

    A coarbitrary implementation for enums.

  2. functionBoundedEnum :: (Eq a, Bounded a, Enum a) => (a -> b) -> a :-> b

    tasty-quickcheck Test.Tasty.QuickCheck

    Provides a Function instance for types with Bounded and Enum. Use only for small types (i.e. not integers): creates the list [minBound..maxBound]!

  3. shrinkBoundedEnum :: (Bounded a, Enum a, Eq a) => a -> [a]

    tasty-quickcheck Test.Tasty.QuickCheck

    Shrink an element of a bounded enumeration.

    Example

    data MyEnum = E0 | E1 | E2 | E3 | E4 | E5 | E6 | E7 | E8 | E9
    deriving (Bounded, Enum, Eq, Ord, Show)
    
    >>> shrinkBoundedEnum E9
    [E0,E5,E7,E8]
    
    >>> shrinkBoundedEnum E5
    [E0,E3,E4]
    
    >>> shrinkBoundedEnum E0
    []
    

  4. uniformEnumM :: (Enum a, Bounded a, StatefulGen g m) => g -> m a

    random System.Random.Stateful

    Generates uniformly distributed Enum. One can use it to define a Uniform instance:

    data Colors = Red | Green | Blue deriving (Enum, Bounded)
    instance Uniform Colors where uniformM = uniformEnumM
    

  5. uniformEnumRM :: (Enum a, StatefulGen g m) => (a, a) -> g -> m a

    random System.Random.Stateful

    Generates uniformly distributed Enum in the given range. One can use it to define a UniformRange instance:

    data Colors = Red | Green | Blue deriving (Enum)
    instance UniformRange Colors where
    uniformRM = uniformEnumRM
    inInRange (lo, hi) x = isInRange (fromEnum lo, fromEnum hi) (fromEnum x)
    

  6. measNumGcs :: Measured -> !Int64

    criterion Criterion.Types

    (GC) Number of garbage collections performed. Access using fromInt.

  7. reportNumber :: Report -> Int

    criterion Criterion.Types

    A simple index indicating that this is the nth report.

  8. getNumElements :: (MArray a e m, Ix i) => a i e -> m Int

    array Data.Array.Base

    Returns the number of elements in the array.

  9. tagToEnum# :: Int# -> a

    ghc-prim GHC.Prim

    No documentation available.

  10. enum :: Enum a => Iso' Int a

    lens Control.Lens.Combinators

    This isomorphism can be used to convert to or from an instance of Enum.

    >>> LT^.from enum
    0
    
    >>> 97^.enum :: Char
    'a'
    
    Note: this is only an isomorphism from the numeric range actually used and it is a bit of a pleasant fiction, since there are questionable Enum instances for Double, and Float that exist solely for [1.0 .. 4.0] sugar and the instances for those and Integer don't cover all values in their range.

Page 147 of many | Previous | Next