This file contains 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 |