Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
last :: HasCallStack => [a] -> aLambdaHack Game.LambdaHack.Core.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
-
cabal-install-solver Distribution.Solver.Compat.Prelude Extract the last element of the stream.
last :: forall (n :: Natural) a . Vec (n + 1) a -> aclash-prelude Clash.Explicit.Prelude Extract the last element of a vector
>>> last (1:>2:>3:>Nil) 3
>>> last Nil <interactive>:... • Couldn't match type ‘1’ with ‘0’ Expected: Vec (0 + 1) a Actual: Vec 0 a • In the first argument of ‘last’, namely ‘Nil’ In the expression: last Nil In an equation for ‘it’: it = last Nil
# 540 "srcClashSized/Vector.hs"last :: forall (n :: Natural) a . Vec (n + 1) a -> aclash-prelude Clash.Explicit.Prelude.Safe Extract the last element of a vector
>>> last (1:>2:>3:>Nil) 3
>>> last Nil <interactive>:... • Couldn't match type ‘1’ with ‘0’ Expected: Vec (0 + 1) a Actual: Vec 0 a • In the first argument of ‘last’, namely ‘Nil’ In the expression: last Nil In an equation for ‘it’: it = last Nil
# 540 "srcClashSized/Vector.hs"last :: forall (n :: Natural) a . Vec (n + 1) a -> aclash-prelude Clash.Prelude Extract the last element of a vector
>>> last (1:>2:>3:>Nil) 3
>>> last Nil <interactive>:... • Couldn't match type ‘1’ with ‘0’ Expected: Vec (0 + 1) a Actual: Vec 0 a • In the first argument of ‘last’, namely ‘Nil’ In the expression: last Nil In an equation for ‘it’: it = last Nil
# 540 "srcClashSized/Vector.hs"last :: forall (n :: Natural) a . Vec (n + 1) a -> aclash-prelude Clash.Prelude.Safe Extract the last element of a vector
>>> last (1:>2:>3:>Nil) 3
>>> last Nil <interactive>:... • Couldn't match type ‘1’ with ‘0’ Expected: Vec (0 + 1) a Actual: Vec 0 a • In the first argument of ‘last’, namely ‘Nil’ In the expression: last Nil In an equation for ‘it’: it = last Nil
# 540 "srcClashSized/Vector.hs"last :: forall (n :: Natural) a . Vec (n + 1) a -> aclash-prelude Clash.Sized.Vector Extract the last element of a vector
>>> last (1:>2:>3:>Nil) 3
>>> last Nil <interactive>:... • Couldn't match type ‘1’ with ‘0’ Expected: Vec (0 + 1) a Actual: Vec 0 a • In the first argument of ‘last’, namely ‘Nil’ In the expression: last Nil In an equation for ‘it’: it = last Nil
# 540 "srcClashSized/Vector.hs"-
incipit-base Incipit.List Return Just the last element of a list.
last :: LRU key val -> !Maybe keylrucache Data.Cache.LRU.Internal the key of the least recently accessed entry
last :: forall (m :: Type -> Type) a . Monad m => Fold m a (Maybe a)streamly-core Streamly.Data.Fold Deprecated: Please use latest instead.