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. head :: HasCallStack => [a] -> a

    base Prelude

    Extract the first element of a list, which must be non-empty. To disable the warning about partiality put {-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-} at the top of the file. To disable it throughout a package put the same options into ghc-options section of Cabal file. To disable it in GHCi put :set -Wno-x-partial -Wno-unrecognised-warning-flags into ~/.ghci config file. See also the migration guide.

    Examples
    >>> head [1, 2, 3]
    1
    
    >>> head [1..]
    1
    
    >>> head []
    *** Exception: Prelude.head: empty list
    

  2. head :: HasCallStack => [a] -> a

    base Data.List

    Extract the first element of a list, which must be non-empty. To disable the warning about partiality put {-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-} at the top of the file. To disable it throughout a package put the same options into ghc-options section of Cabal file. To disable it in GHCi put :set -Wno-x-partial -Wno-unrecognised-warning-flags into ~/.ghci config file. See also the migration guide.

    Examples
    >>> head [1, 2, 3]
    1
    
    >>> head [1..]
    1
    
    >>> head []
    *** Exception: Prelude.head: empty list
    

  3. head :: Foldable1 t => t a -> a

    base Data.Foldable1

    The first element of a non-empty structure.

    >>> head (1 :| [2, 3, 4])
    1
    

  4. head :: NonEmpty a -> a

    base Data.List.NonEmpty

    Extract the first element of the stream.

  5. head :: HasCallStack => [a] -> a

    base GHC.List

    Extract the first element of a list, which must be non-empty. To disable the warning about partiality put {-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-} at the top of the file. To disable it throughout a package put the same options into ghc-options section of Cabal file. To disable it in GHCi put :set -Wno-x-partial -Wno-unrecognised-warning-flags into ~/.ghci config file. See also the migration guide.

    Examples
    >>> head [1, 2, 3]
    1
    
    >>> head [1..]
    1
    
    >>> head []
    *** Exception: Prelude.head: empty list
    

  6. head :: HasCallStack => ByteString -> Word8

    bytestring Data.ByteString

    O(1) Extract the first element of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString. This is a partial function, consider using uncons instead.

  7. head :: ByteString -> Char

    bytestring Data.ByteString.Char8

    O(1) Extract the first element of a ByteString, which must be non-empty.

  8. head :: HasCallStack => ByteString -> Word8

    bytestring Data.ByteString.Lazy

    O(1) Extract the first element of a ByteString, which must be non-empty. This is a partial function, consider using uncons instead.

  9. head :: ByteString -> Char

    bytestring Data.ByteString.Lazy.Char8

    O(1) Extract the first element of a ByteString, which must be non-empty.

  10. head :: HasCallStack => ShortByteString -> Word8

    bytestring Data.ByteString.Short

    O(1) Extract the first element of a ShortByteString, which must be non-empty. An exception will be thrown in the case of an empty ShortByteString. This is a partial function, consider using uncons instead.

Page 1 of many | Next