I have a question about List comprehensions vs the Enum module. While the Enum module can basically do what the comprehension can do… such as
def my_function(arr) do
for x <- arr, do: IO.inspect(x)
end
vs something like
def my_function(arr) do
Enum.map(arr, fn x -> IO.inspect(x) end)
end
is there any performance gains using one rather than the other or any places where one approach is favorable?