Hoogle Search
Within LTS Haskell 24.3 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
ghc-boot GHC.Data.ShortText O(1) Returns the first UTF-8 codepoint in the ShortText. Depending on the string in question, this may or may not be the actual first character in the string due to Unicode non-printable characters.
head :: Monad m => Stream (Of a) m r -> m (Of (Maybe a) r)streaming Streaming.Prelude No documentation available.
head :: YiString -> Maybe Charyi-rope Yi.Rope Take the first character of the underlying string if possible.
-
base-compat-batteries Data.List.NonEmpty.Compat Extract the first element of the stream.
head :: HasCallStack => [a] -> asnap-core Snap.Test 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 :: forall (v :: Type -> Type) (n :: Natural) a . Vector v a => Vector v (1 + n) a -> avector-sized Data.Vector.Generic.Sized O(1) Yield the first element of a non-empty vector.
head :: forall (n :: Natural) a . Prim a => Vector (1 + n) a -> avector-sized Data.Vector.Primitive.Sized O(1) Yield the first element of a non-empty vector.
head :: forall (n :: Natural) a . Vector (1 + n) a -> avector-sized Data.Vector.Sized O(1) Yield the first element of a non-empty vector.
head :: forall (n :: Natural) a . Storable a => Vector (1 + n) a -> avector-sized Data.Vector.Storable.Sized O(1) Yield the first element of a non-empty vector.
head :: forall (n :: Natural) a . Unbox a => Vector (1 + n) a -> avector-sized Data.Vector.Unboxed.Sized O(1) Yield the first element of a non-empty vector.