Hi,
I’m currently learning Elixir on Exercism, and I’m often faced with some exercise where I want to convert data to another type, transform it, and convert the result back to the original type. Unfortunately, the Elixir API reference isn’t particularly supportive in this endeavor.
For example, there is Map.to_list/1. The documentation doesn’t mention an inverse operation. The naming pattern suggests Map.from_list
or List.to_map
, but neither functions exist. The most likely candidate is Map.new/1
, but its documentation doesn’t mention any inverse functions either. An even better example would be String.to_charlist/1, since I can’t find its inverse function.
Am I missing something? Is there a reliable way to find a function’s inverse in the Elixir API reference?
Thank you