Hoogle Search

Within LTS Haskell 24.45 (ghc-9.10.3)

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

  1. (!!) :: HasCallStack => [a] -> Int -> a

    Cabal-syntax Distribution.Compat.Prelude

    No documentation available.

  2. (!!) :: HasCallStack => [a] -> Int -> a

    relude Relude.Unsafe

    List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type. WARNING: This function is partial, and should only be used if you are sure that the indexing will not fail. Otherwise, use !?. WARNING: This function takes linear time in the index.

    Examples

    >>> ['a', 'b', 'c'] !! 0
    'a'
    
    >>> ['a', 'b', 'c'] !! 2
    'c'
    
    >>> ['a', 'b', 'c'] !! 3
    *** Exception: Prelude.!!: index too large
    
    >>> ['a', 'b', 'c'] !! (-1)
    *** Exception: Prelude.!!: negative index
    

  3. (!!) :: [a] -> Offset a -> a

    basement Basement.Compat.ExtList

    No documentation available.

  4. type family (a1 :: NonEmpty a) !! (a2 :: Natural) :: a

    singletons-base Data.List.NonEmpty.Singletons

    No documentation available.

  5. type family (a1 :: [a]) !! (a2 :: Natural) :: a

    singletons-base Data.List.Singletons

    No documentation available.

  6. type family (a1 :: [a]) !! (a2 :: Natural) :: a

    singletons-base Prelude.Singletons

    No documentation available.

  7. (!!) :: HasCallStack => NonEmpty a -> Int -> a

    base-compat-batteries Data.List.NonEmpty.Compat

    xs !! n returns the element of the stream xs at index n. Note that the head of the stream has index 0. Beware: a negative or out-of-bounds index will cause an error.

  8. (!!) :: Infinite a -> Word -> a

    infinite-list Data.List.Infinite

    Return n-th element of an infinite list. On contrary to Data.List.!!, this function takes Word instead of Int to avoid error on negative arguments. If you are concerned that unsigned indices may accidentally underflow, compile with -fno-ignore-asserts: there is an assert checking that the index does not exceed fromIntegral (maxBound :: Int). This is actually index from Representable type class in disguise.

  9. (!!) :: HasCallStack => [a] -> Int -> a

    ghc-internal GHC.Internal.Data.List

    List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type. WARNING: This function is partial, and should only be used if you are sure that the indexing will not fail. Otherwise, use !?. WARNING: This function takes linear time in the index.

    Examples

    >>> ['a', 'b', 'c'] !! 0
    'a'
    
    >>> ['a', 'b', 'c'] !! 2
    'c'
    
    >>> ['a', 'b', 'c'] !! 3
    *** Exception: Prelude.!!: index too large
    
    >>> ['a', 'b', 'c'] !! (-1)
    *** Exception: Prelude.!!: negative index
    

  10. (!!) :: HasCallStack => [a] -> Int -> a

    ghc-internal GHC.Internal.Data.OldList

    List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type. WARNING: This function is partial, and should only be used if you are sure that the indexing will not fail. Otherwise, use !?. WARNING: This function takes linear time in the index.

    Examples

    >>> ['a', 'b', 'c'] !! 0
    'a'
    
    >>> ['a', 'b', 'c'] !! 2
    'c'
    
    >>> ['a', 'b', 'c'] !! 3
    *** Exception: Prelude.!!: index too large
    
    >>> ['a', 'b', 'c'] !! (-1)
    *** Exception: Prelude.!!: negative index
    

Page 2 of many | Previous | Next