Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

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

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

    Stream Data.Stream

    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.

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

    cabal-install-solver Distribution.Solver.Compat.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
    

  3. (!!) :: forall (n :: Nat) i a . (KnownNat n, Enum i) => Vec n a -> i -> a

    clash-prelude Clash.Explicit.Prelude

    "xs !! n" returns the n'th element of xs. NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

    >>> (1:>2:>3:>4:>5:>Nil) !! 4
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! (length (1:>2:>3:>4:>5:>Nil) - 1)
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 1
    2
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 14
    *** Exception: Clash.Sized.Vector.(!!): index 14 is larger than maximum index 4
    ...
    

  4. (!!) :: forall (n :: Nat) i a . (KnownNat n, Enum i) => Vec n a -> i -> a

    clash-prelude Clash.Explicit.Prelude.Safe

    "xs !! n" returns the n'th element of xs. NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

    >>> (1:>2:>3:>4:>5:>Nil) !! 4
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! (length (1:>2:>3:>4:>5:>Nil) - 1)
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 1
    2
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 14
    *** Exception: Clash.Sized.Vector.(!!): index 14 is larger than maximum index 4
    ...
    

  5. (!!) :: forall (n :: Nat) i a . (KnownNat n, Enum i) => Vec n a -> i -> a

    clash-prelude Clash.Prelude

    "xs !! n" returns the n'th element of xs. NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

    >>> (1:>2:>3:>4:>5:>Nil) !! 4
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! (length (1:>2:>3:>4:>5:>Nil) - 1)
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 1
    2
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 14
    *** Exception: Clash.Sized.Vector.(!!): index 14 is larger than maximum index 4
    ...
    

  6. (!!) :: forall (n :: Nat) i a . (KnownNat n, Enum i) => Vec n a -> i -> a

    clash-prelude Clash.Prelude.Safe

    "xs !! n" returns the n'th element of xs. NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

    >>> (1:>2:>3:>4:>5:>Nil) !! 4
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! (length (1:>2:>3:>4:>5:>Nil) - 1)
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 1
    2
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 14
    *** Exception: Clash.Sized.Vector.(!!): index 14 is larger than maximum index 4
    ...
    

  7. (!!) :: forall (n :: Nat) i a . (KnownNat n, Enum i) => Vec n a -> i -> a

    clash-prelude Clash.Sized.Vector

    "xs !! n" returns the n'th element of xs. NB: Vector elements have an ASCENDING subscript starting from 0 and ending at length - 1.

    >>> (1:>2:>3:>4:>5:>Nil) !! 4
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! (length (1:>2:>3:>4:>5:>Nil) - 1)
    5
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 1
    2
    
    >>> (1:>2:>3:>4:>5:>Nil) !! 14
    *** Exception: Clash.Sized.Vector.(!!): index 14 is larger than maximum index 4
    ...
    

  8. (!!) :: SymVal a => SList a -> SInteger -> SBV a

    sbv Data.SBV.List

    Short cut for elemAt

  9. (!!) :: SString -> SInteger -> SChar

    sbv Data.SBV.String

    Short cut for strToCharAt

  10. (!!) :: Monad m => Stream m a -> Int -> m (Maybe a)

    streamly-core Streamly.Internal.Data.Stream

    No documentation available.

Page 5 of many | Previous | Next