O'Reilly logo
  • Pavel Shaydo thinks this is interesting:

we need to remember the partial sum as we process each element in turn

From

Cover of Programming Elixir 1.3

Note

why is that? sum([head|tail]), do head+sum(tail) would work. Is it because of tail call optimization?