Enum.unzip

You're seeing just the function unzip, go back to Enum module for more information.

Specs

unzip(t()) :: {[element()], [element()]}

Opposite of zip/2. Extracts two-element tuples from the given enumerable and groups them together.

It takes an enumerable with elements being two-element tuples and returns a tuple with two lists, each of which is formed by the first and second element of each tuple, respectively.

This function fails unless enumerable is or can be converted into a list of tuples with exactly two elements in each tuple.

Examples

iex> Enum.unzip([{:a, 1}, {:b, 2}, {:c, 3}])
{[:a, :b, :c], [1, 2, 3]}

iex> Enum.unzip(%{a: 1, b: 2})
{[:a, :b], [1, 2]}