Created
August 19, 2016 11:21
-
-
Save zweizeichen/2121a73f0d418dae539ad2c13e4a8f71 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
defmodule Yay do | |
def list_to_map([], map) do | |
map | |
end | |
def list_to_map(list, map) do | |
[key, value] = Enum.take(list, 2) | |
list_to_map(tl(tl(list)), Map.put(map, key, value)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment