There are a few other types to consider as well, namely PIDs, lists, tuples, and functions. I’m not sure how often these would come up in practice. As a shortcut to stringify any of them you can pass the value to inspect/1 and you will get some sort of string representation. I don’t know how useful this string representation would actually be though, I think it depends on the use case.
One thing I noticed in your stringify and atomize functions, you are using the enumerable property of maps to apply the transformation and then casting it back into a map. You can instead use Map.new/2 as a shortcut to do this all at once. For example:
map
|> Enum.map(fn {key, value} -> {stringify_key(key), stringify_value(value)} end)
|> Enum.into(%{})
Can be simply:
Map.new(map, fn {key, value} -> {stringify_key(key), stringify_value(value)} end)






















