Hoogle Search

Within LTS Haskell 24.2 (ghc-9.10.2)

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

  1. (++) :: [a] -> [a] -> [a]

    rio RIO.Prelude

    (++) appends two lists, i.e.,

    [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
    [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
    
    If the first list is not finite, the result is the first list.

    Performance considerations

    This function takes linear time in the number of elements of the first list. Thus it is better to associate repeated applications of (++) to the right (which is the default behaviour): xs ++ (ys ++ zs) or simply xs ++ ys ++ zs, but not (xs ++ ys) ++ zs. For the same reason concat = foldr (++) [] has linear performance, while foldl (++) [] is prone to quadratic slowdown

    Examples

    >>> [1, 2, 3] ++ [4, 5, 6]
    [1,2,3,4,5,6]
    
    >>> [] ++ [1, 2, 3]
    [1,2,3]
    
    >>> [3, 2, 1] ++ []
    [3,2,1]
    

  2. (++) :: Vector v a => v a -> v a -> v a

    rio RIO.Vector

    No documentation available.

  3. (++) :: Vector a -> Vector a -> Vector a

    rio RIO.Vector.Boxed

    No documentation available.

  4. (++) :: Storable a => Vector a -> Vector a -> Vector a

    rio RIO.Vector.Storable

    No documentation available.

  5. (++) :: Unbox a => Vector a -> Vector a -> Vector a

    rio RIO.Vector.Unboxed

    No documentation available.

  6. (++) :: [a] -> [a] -> [a]

    Cabal-syntax Distribution.Compat.Prelude

    No documentation available.

  7. type family (xs :: [k]) ++ (ys :: [k]) :: [k]

    relude Relude.Extra.Type

    Concatenates type-level lists.

    >>> :kind! '[ 'Just 5, 'Nothing] ++ '[ 'Just 3, 'Nothing, 'Just 1]
    '[ 'Just 5, 'Nothing] ++ '[ 'Just 3, 'Nothing, 'Just 1] :: [Maybe
    Natural]
    = '[ 'Just 5, 'Nothing, 'Just 3, 'Nothing, 'Just 1]
    
    >>> :kind! '[] ++ '[ 'Just 3, 'Nothing, 'Just 1]
    '[] ++ '[ 'Just 3, 'Nothing, 'Just 1] :: [Maybe Natural]
    = '[ 'Just 3, 'Nothing, 'Just 1]
    
    # 91 "srcReludeExtra/Type.hs"

  8. (++) :: [a] -> [a] -> [a]

    relude Relude.List.Reexport

    (++) appends two lists, i.e.,

    [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
    [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
    
    If the first list is not finite, the result is the first list.

    Performance considerations

    This function takes linear time in the number of elements of the first list. Thus it is better to associate repeated applications of (++) to the right (which is the default behaviour): xs ++ (ys ++ zs) or simply xs ++ ys ++ zs, but not (xs ++ ys) ++ zs. For the same reason concat = foldr (++) [] has linear performance, while foldl (++) [] is prone to quadratic slowdown

    Examples

    >>> [1, 2, 3] ++ [4, 5, 6]
    [1,2,3,4,5,6]
    
    >>> [] ++ [1, 2, 3]
    [1,2,3]
    
    >>> [3, 2, 1] ++ []
    [3,2,1]
    

  9. data ((b :: [a]) ++ (c :: [a])) (d :: [a])

    first-class-families Fcf

    List catenation.

    Example

    >>> data Example where Ex :: a -> Example  -- Hide the type of examples to avoid brittleness in different GHC versions
    
    >>> :kind! Ex (Eval ([1, 2] ++ [3, 4]) :: [Natural])
    Ex (Eval ([1, 2] ++ [3, 4]) :: [Natural]) :: Example
    = Ex [1, 2, 3, 4]
    

  10. data ((b :: [a]) ++ (c :: [a])) (d :: [a])

    first-class-families Fcf.Data.List

    List catenation.

    Example

    >>> data Example where Ex :: a -> Example  -- Hide the type of examples to avoid brittleness in different GHC versions
    
    >>> :kind! Ex (Eval ([1, 2] ++ [3, 4]) :: [Natural])
    Ex (Eval ([1, 2] ++ [3, 4]) :: [Natural]) :: Example
    = Ex [1, 2, 3, 4]
    

Page 2 of many | Previous | Next