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.

  1. fromDistinctAscList :: Enum k => [k] -> EnumSet k

    enummapset Data.EnumSet

    No documentation available.

  2. fromList :: Enum k => [k] -> EnumSet k

    enummapset Data.EnumSet

    No documentation available.

  3. toAscList :: Enum k => EnumSet k -> [k]

    enummapset Data.EnumSet

    No documentation available.

  4. toDescList :: Enum k => EnumSet k -> [k]

    enummapset Data.EnumSet

    No documentation available.

  5. toList :: Enum k => EnumSet k -> [k]

    enummapset Data.EnumSet

    No documentation available.

  6. 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]
    

  7. maybeToList :: Maybe a -> [a]

    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
    

  8. module GHC.Internal.Data.OldList

    Operations on lists.

  9. fromList :: Manifest r e => Comp -> [e] -> Vector r e

    massiv Data.Massiv.Array

    Convert a flat list into a vector

  10. fromLists' :: forall r ix e . (HasCallStack, Ragged L ix e, Manifest r e) => Comp -> [ListItem ix e] -> Array r ix e

    massiv Data.Massiv.Array

    Same as fromListsM, but will throw an error on irregular shaped lists. Note: This function is the same as if you would turn on {-# LANGUAGE OverloadedLists #-} extension. For that reason you can also use fromList.

    \xs -> fromLists' Seq xs == (fromList Seq xs :: Vector P Int)
    

    Examples

    Convert a list of lists into a 2D Array
    >>> import Data.Massiv.Array as A
    
    >>> fromLists' Seq [[1,2,3],[4,5,6]] :: Array U Ix2 Int
    Array U Seq (Sz (2 :. 3))
    [ [ 1, 2, 3 ]
    , [ 4, 5, 6 ]
    ]
    
    Above example implemented using GHC's OverloadedLists extension:
    >>> :set -XOverloadedLists
    
    >>> [[1,2,3],[4,5,6]] :: Array U Ix2 Int
    Array U Seq (Sz (2 :. 3))
    [ [ 1, 2, 3 ]
    , [ 4, 5, 6 ]
    ]
    

Page 94 of many | Previous | Next