Skip to content

Instantly share code, notes, and snippets.

@wende
Created September 8, 2015 13:40
Show Gist options
  • Select an option

  • Save wende/25cab8823c545b08f6d2 to your computer and use it in GitHub Desktop.

Select an option

Save wende/25cab8823c545b08f6d2 to your computer and use it in GitHub Desktop.
def sum_list([], acc), do: acc
def sum_list([head | tail], acc // 0) do
sum_list(tail, head + acc)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment