The expression could have been even shorter
Enum.reduce([1, 2, 3], &+/2)
For this specific case, the more succint option is Enum.sum/1.
The capture is very powerful, you can make things like &"Hello #{&1}", also with charlists, tuples, maps, structs… ![]()






















