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 => ShortByteString -> Word8bytestring Data.ByteString.Short.Internal 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.
head :: HasCallStack => Text -> Chartext Data.Text O(1) Returns the first character of a Text, which must be non-empty. This is a partial function, consider using uncons instead.
head :: HasCallStack => Stream Char -> Chartext Data.Text.Internal.Fusion.Common O(1) Returns the first character of a Stream Char, which must be non-empty. This is a partial function, consider using uncons. Properties
head . stream = head
head :: HasCallStack => Text -> Chartext Data.Text.Lazy O(1) Returns the first character of a Text, which must be non-empty. This is a partial function, consider using uncons instead.
-
lens Control.Lens.Internal.Doctest No documentation available.
head :: forall (m :: Type -> Type) a o . Monad m => ConduitT a o m (Maybe a)conduit Data.Conduit.Combinators Take a single value from the stream, if available.
head :: forall (m :: Type -> Type) a o . Monad m => ConduitT a o m (Maybe a)conduit Data.Conduit.List Take a single value from the stream, if available. Subject to fusion Since 0.3.0
head :: HasCallStack => [a] -> ahedgehog Hedgehog.Internal.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
-
base-compat Data.List.NonEmpty.Compat Extract the first element of the stream.
-
dlist Data.DList head xs is the first element of xs. If xs is empty, an error is raised. <math>(1). head obeys the law:
head xs = head (toList xs)