Enum.reduce/3 transforms an enumerable into any accumulated result. It receives the enumerable, an initial accumulator, and a function called for each element; that function returns the next accumulator, and the final accumulator becomes the result. section 3.4.3
Summing a list
Enum.reduce([1, 2, 3], 0, fn element, sum -> sum + element end) returns 6. The initial value is 0, and each invocation computes the next sum without mutating the previous accumulator. The shorter Enum.reduce([1, 2, 3], 0, &+/2) form expresses the same operation. section 3.4.3
Building a structure iteratively
A constructor can reduce raw entries into a TodoList struct by starting with %TodoList{} and calling add_entry/2 for each entry. Because reduce passes the element before the accumulator, the capture form reverses them with &add_entry(&2, &1). section 4.2.4
