Skip to content

Commit 4942ac9

Browse files
committed
Add deprecated version
1 parent 55e7b16 commit 4942ac9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## Unreleased
44

55
- The `list` module gains the `list.map2` function.
6-
- `flatten` has been renamed to `concat` in the `list` module.
6+
- `flatten` has been renamed to `concat` in the `list` module. The old name is
7+
still available as an alias and is deprecated.
78

89
## v0.29.2 - 2023-06-21
910

src/gleam/list.gleam

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,12 @@ pub fn concat(lists: List(List(a))) -> List(a) {
683683
do_concat(lists, [])
684684
}
685685

686+
// TODO: Add deprecation attribute and then remove later.
687+
/// This function is deprecated, see `concat` instead.
688+
pub fn flatten(lists: List(List(a))) -> List(a) {
689+
do_concat(lists, [])
690+
}
691+
686692
/// Maps the list with the given function into a list of lists, and then flattens it.
687693
///
688694
/// ## Examples

0 commit comments

Comments
 (0)