Hoogle Search

Within LTS Haskell 24.3 (ghc-9.10.2)

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

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

    ghc-internal GHC.Internal.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
    

  2. (!!) :: 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.

  3. (!!) :: MakeObject this => this -> Int -> JSM JSVal

    jsaddle Language.Javascript.JSaddle.Object

    Lookup a property based on its index.

    >>> testJSaddle $ eval "'Hello World'[6]"
    W
    
    >>> testJSaddle $ val "Hello World" !! 6
    W
    

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

    numeric-prelude NumericPrelude

    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
    

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

    numeric-prelude NumericPrelude.Base

    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
    

  6. (!!) :: C n => [a] -> n -> a

    numeric-prelude NumericPrelude.List.Checked

    The index must be smaller than the length of the list, otherwise the result is undefined.

  7. (!!) :: C n => [a] -> n -> a

    numeric-prelude NumericPrelude.List.Generic

    The index must be smaller than the length of the list, otherwise the result is undefined.

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

    numhask NumHask.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. 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
    

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

    basic-prelude BasicPrelude

    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. (!!) :: Infinite a -> Int -> a

    ghc-lib-parser GHC.Data.List.Infinite

    No documentation available.

Page 3 of many | Previous | Next