Skip to content

Commit 538da73

Browse files
Change anonimous functions to fn format
1 parent f7e1380 commit 538da73

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/elixir/lib/enum.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,10 +2873,10 @@ defmodule Enum do
28732873
28742874
## Examples
28752875
2876-
iex> Enum.scan(["a", "b", "c", "d", "e"], &(&1 <> String.first(&2)))
2876+
iex> Enum.scan(["a", "b", "c", "d", "e"], fn element, acc -> element <> String.first(acc) end)
28772877
["a", "ba", "cb", "dc", "ed"]
28782878
2879-
iex> Enum.scan(1..5, &(&1 + &2))
2879+
iex> Enum.scan(1..5, fn element, acc -> element + acc end)
28802880
[1, 3, 6, 10, 15]
28812881
28822882
"""
@@ -2904,10 +2904,10 @@ defmodule Enum do
29042904
29052905
## Examples
29062906
2907-
iex> Enum.scan(["a", "b", "c", "d", "e"], "_", &(&1 <> String.first(&2)))
2907+
iex> Enum.scan(["a", "b", "c", "d", "e"], "_", fn element, acc -> element <> String.first(acc) end)
29082908
["a_", "ba", "cb", "dc", "ed"]
29092909
2910-
iex> Enum.scan(1..5, 0, &(&1 + &2))
2910+
iex> Enum.scan(1..5, 0, fn element, acc -> element + acc end)
29112911
[1, 3, 6, 10, 15]
29122912
29132913
"""

0 commit comments

Comments
 (0)