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.
head :: HasCallStack => [a] -> abase 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
head :: HasCallStack => [a] -> abase 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
head :: Foldable1 t => t a -> abase Data.Foldable1 The first element of a non-empty structure.
>>> head (1 :| [2, 3, 4]) 1
-
base Data.List.NonEmpty Extract the first element of the stream.
head :: HasCallStack => [a] -> abase 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
head :: HasCallStack => ByteString -> Word8bytestring 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.
-
bytestring Data.ByteString.Char8 O(1) Extract the first element of a ByteString, which must be non-empty.
head :: HasCallStack => ByteString -> Word8bytestring 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.
-
bytestring Data.ByteString.Lazy.Char8 O(1) Extract the first element of a ByteString, which must be non-empty.
head :: HasCallStack => ShortByteString -> Word8bytestring 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