diff options
author | Giacomo Cavalieri <giacomo.cavalieri@icloud.com> | 2023-08-26 13:42:38 +0200 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2023-09-04 12:50:50 +0100 |
commit | 5832ccd7189549dbb4ae4fb6b6cd249883446454 (patch) | |
tree | 839641165eee4fa0e6cca5bebc218651220fed49 /src | |
parent | 9b3f2296ec5b1937abe618cc28716a30c712c20d (diff) | |
download | gleam_stdlib-5832ccd7189549dbb4ae4fb6b6cd249883446454.tar.gz gleam_stdlib-5832ccd7189549dbb4ae4fb6b6cd249883446454.zip |
Remove the deprecation notice from `list.flatten`
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/list.gleam | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index 90ca12a..4836f92 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -680,8 +680,18 @@ pub fn concat(lists: List(List(a))) -> List(a) { do_concat(lists, []) } -// TODO: Add deprecation attribute and then remove later. -/// This function is deprecated, see `concat` instead. +/// This is the same as `concat`: it joins a list of lists into a single +/// list. +/// +/// This function traverses all elements twice. +/// +/// ## Examples +/// +/// ```gleam +/// > flatten([[1], [2, 3], []]) +/// [1, 2, 3] +/// ``` +/// pub fn flatten(lists: List(List(a))) -> List(a) { do_concat(lists, []) } |