Created
July 21, 2016 07:00
-
-
Save enil/abe9f1951ca2f0feeb4776afc0bb2cf2 to your computer and use it in GitHub Desktop.
Convert keyword list for erlang libraries
This file contains hidden or 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
# convert every (binary) string value in the keyword list to a character list | |
args |> Enum.map(fn | |
v when is_binary(v) -> to_charlist(v) | |
{k, v} when is_binary(v) -> {k, to_charlist(v)} | |
any -> any | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment