Last active
June 16, 2018 20:32
-
-
Save titouancreach/7a1349729fba9712a7d1bace3735c6a9 to your computer and use it in GitHub Desktop.
[a, b, c, d] to [{a, b}, {c, d}] in elixir
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
def make(s) do | |
case (s) do | |
[line, sens | rest] -> [{line, sens} | make(rest)] | |
[] -> [] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment