Skip to content

Commit af3624c

Browse files
authored
Mention how zip_with/2 could be use as a transpose function (#15012)
1 parent bd909cb commit af3624c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/elixir/lib/enum.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4183,6 +4183,11 @@ defmodule Enum do
41834183
iex> Enum.zip_with([[1, 2], [3, 4]], fn [x, y] -> x + y end)
41844184
[4, 6]
41854185
4186+
`zip_with/2` can be used to transpose lists of lists:
4187+
4188+
iex> Enum.zip_with([[1, 2,], [3, 4]], & &1)
4189+
[[1, 3], [2, 4]]
4190+
41864191
"""
41874192
@doc since: "1.12.0"
41884193
@spec zip_with(t, ([term] -> term)) :: [term]

0 commit comments

Comments
 (0)