From 8f4525c8b2ec13c3d4870d9932e251f30551deae Mon Sep 17 00:00:00 2001 From: sabiwara Date: Sun, 14 Dec 2025 18:57:01 +0900 Subject: [PATCH] Mention how zip_with/2 could be use as a transpose function --- lib/elixir/lib/enum.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/elixir/lib/enum.ex b/lib/elixir/lib/enum.ex index 8a8a3e89937..2a9af55ac17 100644 --- a/lib/elixir/lib/enum.ex +++ b/lib/elixir/lib/enum.ex @@ -4183,6 +4183,11 @@ defmodule Enum do iex> Enum.zip_with([[1, 2], [3, 4]], fn [x, y] -> x + y end) [4, 6] + `zip_with/2` can be used to transpose lists of lists: + + iex> Enum.zip_with([[1, 2,], [3, 4]], & &1) + [[1, 3], [2, 4]] + """ @doc since: "1.12.0" @spec zip_with(t, ([term] -> term)) :: [term]