You can reduce with list comprehensions in Elixir, but it's uncommon to see:
sum_list = fn list ->
for item <- list,
reduce: 0,
do: (sum -> sum + item)
end
sum_list.([1,2,3])
Other comments are correct that `Enum.reduce/2` is probably better:
Enum.reduce(list, &(&1 + &2))
Obviously you don't have the flexibility / mutability you refer to in other comments with either of these, but you can always put more in your accumulator: