Created
February 25, 2019 20:46
-
-
Save franckstifler/1c3efba5a371017ec8f77cea5cb3993c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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