matrix
|> Enum.zip()
|> Enum.map(&Tuple.to_list/1)
Or
Enum.zip(matrix)
|> Enum.map(&Tuple.to_list/1)
matrix
|> Enum.zip()
|> Enum.map(&Tuple.to_list/1)
Or
Enum.zip(matrix)
|> Enum.map(&Tuple.to_list/1)
I’d lean towards the first option since it’s very clear what’s going into the pipe. For what it’s worth, Credo has a check for this as well: Credo.Check.Refactor.PipeChainStart — Credo v1.6.7.
Also prefer first method, looks very Elixiry