From 5832ccd7189549dbb4ae4fb6b6cd249883446454 Mon Sep 17 00:00:00 2001 From: Giacomo Cavalieri Date: Sat, 26 Aug 2023 13:42:38 +0200 Subject: Remove the deprecation notice from `list.flatten` --- src/gleam/list.gleam | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') 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, []) } -- cgit v1.2.3