alphabet_positions = {"a" => 1, "b" => 2, "c" => 3, ...}
Enum.reduce(alphabet_positions, 0, fn({letter, number}, accumulator) ->
if "aeiou" =~ letter do
accumulator += number
end
accumulator
end)
This trivial example adds up the positions of all the vowels in the alphabet.


















