Last active
August 29, 2015 14:07
-
-
Save tonini/485e50ea96a7fe70362e to your computer and use it in GitHub Desktop.
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
# Style 1 | |
defmodule Math do | |
def double_each([]), do: [] | |
def double_each([head|tail]) do | |
[head * 2 | double_each(tail)] | |
end | |
end | |
# Style 2 | |
defmodule Math do | |
def double_each([head|tail]) do | |
[head * 2 | double_each(tail)] | |
end | |
def double_each([]) do | |
[] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment