Skip to content

Instantly share code, notes, and snippets.

@titouancreach
Last active June 16, 2018 20:32
Show Gist options
  • Save titouancreach/7a1349729fba9712a7d1bace3735c6a9 to your computer and use it in GitHub Desktop.
Save titouancreach/7a1349729fba9712a7d1bace3735c6a9 to your computer and use it in GitHub Desktop.
[a, b, c, d] to [{a, b}, {c, d}] in elixir
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