Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

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

  1. decodeNum32 :: Num a => ByteString -> a

    network-transport Network.Transport.Internal

    Decode any Num type from 32 bits by using fromIntegral to convert from a Word32.

  2. encodeEnum16 :: Enum a => a -> ByteString

    network-transport Network.Transport.Internal

    Encode an Enum in 16 bits by encoding its signed Int equivalent (beware of truncation, an Enum may contain more than 2^16 points).

  3. encodeEnum32 :: Enum a => a -> ByteString

    network-transport Network.Transport.Internal

    Encode an Enum in 32 bits by encoding its signed Int equivalent (beware of truncation, an Enum may contain more than 2^32 points).

  4. tryToEnum :: (Enum a, Bounded a) => Int -> Maybe a

    network-transport Network.Transport.Internal

    Safe version of toEnum

  5. module Relude.Enum

    Reexports Enum related typeclasses and functions. Also introduces a few useful helpers to work with Enums. Note: universe, universeNonEmpty and inverseMap were previously in the extra modules, but due to their benefit in different use cases. If you imported Relude.Extra.Enum module, you can remove it now, as these functions are reexported in the main Relude module.

  6. class Enum a

    relude Relude.Enum

    Class Enum defines operations on sequentially ordered types. The enumFrom... methods are used in Haskell's translation of arithmetic sequences. Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by fromEnum from 0 through n-1. See Chapter 10 of the Haskell Report for more details. For any type that is an instance of class Bounded as well as Enum, the following should hold:

    enumFrom     x   = enumFromTo     x maxBound
    enumFromThen x y = enumFromThenTo x y bound
    where
    bound | fromEnum y >= fromEnum x = maxBound
    | otherwise                = minBound
    

  7. boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]

    relude Relude.Enum

    No documentation available.

  8. boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]

    relude Relude.Enum

    No documentation available.

  9. enumFrom :: Enum a => a -> [a]

    relude Relude.Enum

    Used in Haskell's translation of [n..] with [n..] = enumFrom n, a possible implementation being enumFrom n = n : enumFrom (succ n).

    Examples

    • enumFrom 4 :: [Integer] = [4,5,6,7,...]
    • enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound ::
      Int]

  10. enumFromThen :: Enum a => a -> a -> [a]

    relude Relude.Enum

    Used in Haskell's translation of [n,n'..] with [n,n'..] = enumFromThen n n', a possible implementation being enumFromThen n n' = n : n' : worker (f x) (f x n'), worker s v = v : worker s (s v), x = fromEnum n' - fromEnum n and

    f n y
    | n > 0 = f (n - 1) (succ y)
    | n < 0 = f (n + 1) (pred y)
    | otherwise = y
    
    

    Examples

    • enumFromThen 4 6 :: [Integer] = [4,6,8,10...]
    • enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound ::
      Int]

Page 214 of many | Previous | Next