Hoogle Search
Within LTS Haskell 24.27 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromDistinctAscList :: Enum k => [k] -> EnumSet kenummapset Data.EnumSet No documentation available.
fromList :: Enum k => [k] -> EnumSet kenummapset Data.EnumSet No documentation available.
toAscList :: Enum k => EnumSet k -> [k]enummapset Data.EnumSet No documentation available.
toDescList :: Enum k => EnumSet k -> [k]enummapset Data.EnumSet No documentation available.
toList :: Enum k => EnumSet k -> [k]enummapset Data.EnumSet No documentation available.
toList :: Foldable t => t a -> [a]ghc-internal GHC.Internal.Data.Foldable List of elements of a structure, from left to right. If the entire list is intended to be reduced via a fold, just fold the structure directly bypassing the list.
Examples
Basic usage:>>> toList Nothing []
>>> toList (Just 42) [42]
>>> toList (Left "foo") []
>>> toList (Node (Leaf 5) 17 (Node Empty 12 (Leaf 8))) [5,17,12,8]
For lists, toList is the identity:>>> toList [1, 2, 3] [1,2,3]
-
ghc-internal GHC.Internal.Data.Maybe The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.
Examples
Basic usage:>>> maybeToList (Just 7) [7]
>>> maybeToList Nothing []
One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> sum $ maybeToList (readMaybe "3") 3 >>> sum $ maybeToList (readMaybe "") 0
module GHC.Internal.Data.
OldList Operations on lists.
prependList :: [a] -> Infinite a -> Infinite ainfinite-list Data.List.Infinite Prepend a list to an infinite list.
-
infinite-list Data.List.Infinite Convert to a list. Use cycle to go in the opposite direction.