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.
-
binary-list Data.BinaryList O(log n). Get the last element of a binary list.
last :: HasCallStack => [a] -> acalligraphy Calligraphy.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 :: 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
# 537 "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
# 537 "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
# 537 "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
# 537 "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
# 537 "srcClashSized/Vector.hs"last :: forall i o u (m :: Type -> Type) . Pipe i o u m (Maybe i)conduino Data.Conduino.Combinators Get the last item emitted by a stream. To get the first item ("head"), use await or awaitSurely.
last :: HasCallStack => [a] -> adimensional Numeric.Units.Dimensional.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 :: HasCallStack => [a] -> adistribution-opensuse OpenSuse.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