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

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

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

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

  5. type (!!) = Cont

    control-dsl Control.Dsl.Cont

    A type alias to Cont for a deeply nested delimited continuation.

    Examples

    >>> :set -XTypeOperators
    
    >>> :set -XRebindableSyntax
    
    >>> import Prelude hiding ((>>), (>>=), return, fail)
    
    >>> import Control.Dsl
    
    >>> import Control.Dsl.Yield
    
    >>> import Control.Dsl.Empty
    
    >>> import Control.Dsl.Monadic
    
    >>> :{
    f :: IO () !! [Integer] !! [String] !! [Double]
    f = do
    Yield "foo"
    Yield 0.5
    Yield "bar"
    Yield 42
    Yield "baz"
    return ([] :: [Double])
    :}
    
    >>> :{
    f >>= (\d -> do { Monadic $ putStrLn $ "double list: " ++ show d
    ; return ([] :: [String]) })
    >>= (\s -> do { Monadic $ putStrLn $ "string list: " ++ show s
    ; return ([] :: [Integer]) })
    >>= (\i -> do { Monadic $ putStrLn $ "integer list: " ++ show i
    ; return () })
    :}
    double list: [0.5]
    string list: ["foo","bar","baz"]
    integer list: [42]
    

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

    dimensional Numeric.Units.Dimensional.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

    distribution-opensuse OpenSuse.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
    

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

    faktory Faktory.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

    hledger-web Hledger.Web.Import

    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. (!!) :: forall (f :: Type -> Type) (m :: Nat) a . (CFoldable f, Dom f a, 1 <= m) => Sized f m a -> Int -> a

    sized Data.Sized

    (Unsafe) indexing with Ints. If you want to check boundary statically, use %!! or sIndex. Since 0.7.0.0

Page 6 of many | Previous | Next