Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
last :: HasCallStack => [a] -> anumhask NumHask.Prelude 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 :: ListLike full item => full -> itemListLike Data.ListLike Extracts the last element of a ListLike.
last :: ListLike full item => full -> itemListLike Data.ListLike.Base Extracts the last element of a ListLike.
last :: HasCallStack => [a] -> abasic-prelude BasicPrelude 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 => [a] -> aghc-lib-parser GHC.Prelude.Basic 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 :: Sequential c => NonEmpty c -> Element cfoundation Foundation get the last element of a non-empty collection
last :: Sequential c => NonEmpty c -> Element cfoundation Foundation.Collection get the last element of a non-empty collection
-
nonempty-containers Data.Sequence.NonEmpty O(1). Retrieve the right-most item in a non-empty sequence. Note that this function is total.
-
prelude-compat Data.List2010 No documentation available.
-
prelude-compat Prelude2010 No documentation available.