Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
enumFromThen :: Enum a => a -> a -> [a]Cabal-syntax Distribution.Compat.Prelude No documentation available.
enumFromThenTo :: Enum a => a -> a -> a -> [a]Cabal-syntax Distribution.Compat.Prelude No documentation available.
enumFromTo :: Enum a => a -> a -> [a]Cabal-syntax Distribution.Compat.Prelude No documentation available.
enumLaws :: (Enum a, Eq a, Arbitrary a, Show a) => Proxy a -> Lawsquickcheck-classes-base Test.QuickCheck.Classes.Base Tests the following properties:
This only works for Enum types that are not bounded, meaning that succ and pred must be total. This means that these property tests work correctly for types like Integer but not for Int. Sadly, there is not a good way to test fromEnum and toEnum, since many types that have reasonable implementations for succ and pred have more inhabitants than Int does.enumTypeFrom :: IsEnumType a => a -> NS (K () :: [Type] -> Type) (Code a)generics-sop Generics.SOP Convert from an enum type to its sum representation.
enumTypeTo :: IsEnumType a => NS (K () :: [Type] -> Type) (Code a) -> agenerics-sop Generics.SOP Convert a sum representation to ihe original type.
enumTypeFrom :: IsEnumType a => a -> NS (K () :: [Type] -> Type) (Code a)generics-sop Generics.SOP.Universe Convert from an enum type to its sum representation.
enumTypeTo :: IsEnumType a => NS (K () :: [Type] -> Type) (Code a) -> agenerics-sop Generics.SOP.Universe Convert a sum representation to ihe original type.
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]
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]