Hoogle Search
Within LTS Haskell 23.27 (ghc-9.8.4)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
(
!! ) :: HasCallStack => [a] -> Int -> abase 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
(
!! ) :: HasCallStack => [a] -> Int -> abase 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
(
!! ) :: HasCallStack => NonEmpty a -> Int -> abase 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.
(
!! ) :: HasCallStack => [a] -> Int -> abase 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. 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
(
!! ) :: HasCallStack => [a] -> Int -> abase 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. 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
(
!! ) :: HasCallStack => [a] -> Int -> ahedgehog 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. 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
(
!! ) :: HasCallStack => NonEmpty a -> Int -> abase-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.
(
!! ) :: Infinite a -> Int -> aghc GHC.Data.List.Infinite No documentation available.
(
!! ) :: HasCallStack => [a] -> Int -> aghc GHC.Prelude.Basic 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
(
!! ) :: HasCallStack => [a] -> Int -> ario RIO.List.Partial 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 1 of many | Next