diff options
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/gleam/list.gleam | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 18f9c04..6213b65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## Unreleased - The `list` module gains the `list.map2` function. -- `flatten` has been renamed to `concat` in the `list` module. +- `flatten` has been renamed to `concat` in the `list` module. The old name is + still available as an alias and is deprecated. ## v0.29.2 - 2023-06-21 diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index ed1d718..75a66ef 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -683,6 +683,12 @@ 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. +pub fn flatten(lists: List(List(a))) -> List(a) { + do_concat(lists, []) +} + /// Maps the list with the given function into a list of lists, and then flattens it. /// /// ## Examples |