Skip to content

Instantly share code, notes, and snippets.

@franckstifler
Created February 25, 2019 20:46
Show Gist options
  • Save franckstifler/1c3efba5a371017ec8f77cea5cb3993c to your computer and use it in GitHub Desktop.
Save franckstifler/1c3efba5a371017ec8f77cea5cb3993c to your computer and use it in GitHub Desktop.
defmodule Lister do
def flatten([head | tail]) do
flatten(head) ++ flatten(tail)
end
def flatten([]), do: []
def flatten(head), do: [head]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment