Hoogle Search
Within LTS Haskell 24.17 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
last :: HasCallStack => [a] -> abase GHC.List Extract the last element of a list, which must be finite and non-empty. WARNING: This function is partial. Consider using unsnoc instead.
Examples
>>> last [1, 2, 3] 3
>>> last [1..] * Hangs forever *
>>> last [] *** Exception: Prelude.last: empty list
last :: HasCallStack => ByteString -> Word8bytestring Data.ByteString O(1) Extract the last element of a ByteString, which must be finite and non-empty. An exception will be thrown in the case of an empty ByteString. This is a partial function, consider using unsnoc instead.
-
bytestring Data.ByteString.Char8 O(1) Extract the last element of a packed string, which must be non-empty.
last :: HasCallStack => ByteString -> Word8bytestring Data.ByteString.Lazy O(n/c) Extract the last element of a ByteString, which must be finite and non-empty. This is a partial function, consider using unsnoc instead.
-
bytestring Data.ByteString.Lazy.Char8 O(1) Extract the last element of a packed string, which must be non-empty.
last :: HasCallStack => ShortByteString -> Word8bytestring Data.ByteString.Short O(1) Extract the last element of a ShortByteString, which must be finite and non-empty. An exception will be thrown in the case of an empty ShortByteString. This is a partial function, consider using unsnoc instead.
last :: HasCallStack => ShortByteString -> Word8bytestring Data.ByteString.Short.Internal O(1) Extract the last element of a ShortByteString, which must be finite and non-empty. An exception will be thrown in the case of an empty ShortByteString. This is a partial function, consider using unsnoc instead.
last :: HasCallStack => Text -> Chartext Data.Text O(1) Returns the last character of a Text, which must be non-empty. This is a partial function, consider using unsnoc instead.
last :: HasCallStack => Stream Char -> Chartext Data.Text.Internal.Fusion.Common O(n) Returns the last character of a Stream Char, which must be non-empty. Properties
last . stream = last
last :: HasCallStack => Text -> Chartext Data.Text.Lazy O(n/c) Returns the last character of a Text, which must be non-empty. This is a partial function, consider using unsnoc instead.