Skip to content

Instantly share code, notes, and snippets.

@enil
Created July 21, 2016 07:00
Show Gist options
  • Save enil/abe9f1951ca2f0feeb4776afc0bb2cf2 to your computer and use it in GitHub Desktop.
Save enil/abe9f1951ca2f0feeb4776afc0bb2cf2 to your computer and use it in GitHub Desktop.
Convert keyword list for erlang libraries
# 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