#elixir
3 iterations via pipe operator
or 1 iteration via comprehension
3 iterations via pipe operator
people
|> Enum.filter(& &1.active)
|> Enum.map(&{&1.name, &1})
|> Enum.into(%{})
or 1 iteration via comprehension
for %{active: true} = person <- people, into: %{} do
{<a href="http://person.name">person.name</a>, person}
end
Alex Gleason
•