Skip to content

Commit 0d13468

Browse files
committed
Deprecate List.concat/1,2
1 parent 6ef031b commit 0d13468

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

lib/elixir/lib/list.ex

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,15 @@ defmodule List do
1212

1313
@compile :inline_list_funcs
1414

15-
@doc """
16-
Given a list of lists, concatenate the sublists into a single list.
17-
18-
## Examples
19-
20-
iex> List.concat([[1, [2], 3], [4], [5, 6]])
21-
[1,[2],3,4,5,6]
22-
23-
"""
15+
@doc false
2416
def concat(list) when is_list(list) do
17+
IO.write "List.concat/1 is deprecated, please use Enum.concat/1 instead\n#{Exception.format_stacktrace}"
2518
:lists.append(list)
2619
end
2720

28-
@doc """
29-
Concatenates the list on the right with the list on the left.
30-
31-
This function produces the same result the `++` operator.
32-
33-
## Examples
34-
35-
iex> List.concat([1, 2, 3], [4, 5, 6])
36-
[1,2,3,4,5,6]
37-
38-
"""
21+
@doc false
3922
def concat(list, elements) when is_list(list) and is_list(elements) do
23+
IO.write "List.concat/2 is deprecated, please use Enum.concat/2 instead\n#{Exception.format_stacktrace}"
4024
list ++ elements
4125
end
4226

0 commit comments

Comments
 (0)