Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

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

  1. (!!) :: Monad m => SerialT m a -> Int -> m (Maybe a)

    streamly Streamly.Internal.Data.Stream.IsStream

    Lookup the element at the given index.

  2. (!!) :: Monad m => SerialT m a -> Int -> m (Maybe a)

    streamly Streamly.Prelude

    Lookup the element at the given index.

  3. (!!) :: Stream a -> Int -> a

    streams Data.Stream.Infinite

    xs !! n returns the element of the stream xs at index n. Note that the head of the stream has index 0. Beware: passing a negative integer as the first argument will cause an error.

  4. (!!) :: Zipper a -> Integer -> a

    streams Data.Stream.Infinite.Functional.Zipper

    xs !! n returns the element of the stream xs at index n. Note that the head of the stream has index 0.

  5. (!!) :: Stream a -> Integer -> a

    streams Data.Stream.Infinite.Skew

    O(log n).

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

    constrained-categories Control.Category.Constrained.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
    

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

    constrained-categories Control.Category.Hask

    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
    

  8. (!!) :: forall (n :: Nat) t . Stream (Array n t) -> Stream Word32 -> Projection (Array n t) (Stream Word32) t

    copilot-language Copilot.Language.Operators.Array

    Pair a stream with an element accessor, without applying it to obtain the value of the element. This function is needed to refer to an element accessor when the goal is to update the element value, not just to read it.

  9. (!!) :: (MonadThrow m, Integral n) => [a] -> n -> m a

    listsafe Data.List.Safe

    List index (subscript) operator, starting from 0. Indices larger than length xs - 1 throw an EmptyListException, negative indices throw an NegativeIndexException.

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

    xmonad-contrib XMonad.Config.Prime

    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 7 of many | Previous | Next