aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcin Puc <marcin.e.puc@gmail.com>2021-04-14 23:39:32 +0200
committerLouis Pilfold <louis@lpil.uk>2021-04-15 23:03:51 +0100
commita7ca99d04c9e2f164ce4a6fffc6b39c5e5ff1399 (patch)
tree8a98a3fadfe418738ac852900ebd2abe4ad2422e /src
parent032f840e212f82f9b940fe75cdd4789db9aa2ba2 (diff)
downloadgleam_stdlib-a7ca99d04c9e2f164ce4a6fffc6b39c5e5ff1399.tar.gz
gleam_stdlib-a7ca99d04c9e2f164ce4a6fffc6b39c5e5ff1399.zip
Add note about performance for list.last
Diffstat (limited to 'src')
-rw-r--r--src/gleam/list.gleam4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam
index f99b729..17ee57d 100644
--- a/src/gleam/list.gleam
+++ b/src/gleam/list.gleam
@@ -1436,6 +1436,10 @@ pub fn scan(
///
/// Returns `Error(Nil)` if the list is empty.
///
+/// This function runs in linear time.
+/// For a collection oriented around performant access at either end,
+/// see `gleam/queue.Queue`.
+///
/// ## Examples
///
/// > last([])