Hoogle Search

Within LTS Haskell 22.21 (ghc-9.6.5)

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

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

    base Prelude

    List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type.

    >>> ['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
    
    WARNING: This function is partial. You can use atMay instead.

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

    base 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.

    >>> ['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
    
    WARNING: This function is partial. You can use atMay instead.

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

    base Data.List.NonEmpty

    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.

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

    base GHC.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.

    >>> ['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
    
    WARNING: This function is partial. You can use atMay instead.

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

    base GHC.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.

    >>> ['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
    
    WARNING: This function is partial. You can use atMay instead.

  6. (!!) :: Bundle v a -> Int -> a

    vector Data.Vector.Fusion.Bundle

    Element at the given position

  7. (!!) :: Monad m => Bundle m v a -> Int -> m a

    vector Data.Vector.Fusion.Bundle.Monadic

    Element at the given position

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

    amazonka-core Amazonka.Prelude

    List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type.

    >>> ['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
    
    WARNING: This function is partial. You can use atMay instead.

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

    base-compat 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.

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

    hedgehog Hedgehog.Internal.Prelude

    List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type.

    >>> ['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
    
    WARNING: This function is partial. You can use atMay instead.

Page 1 of many | Next