Skip to content

Instantly share code, notes, and snippets.

@edisonywh
Created November 30, 2018 09:18
Show Gist options
  • Save edisonywh/c9e223be2f127c2f8e19fa920192f9b7 to your computer and use it in GitHub Desktop.
Save edisonywh/c9e223be2f127c2f8e19fa920192f9b7 to your computer and use it in GitHub Desktop.
defmodule Recursion do
def traverse([]), do: IO.puts "Done"
def traverse([head | tail]) do
IO.puts "Element: #{head}"
traverse(tail)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment