I have a function which returns a Map, converted from List(:erlang.memory()). It works as I expected, but it doesn't seem to be beautiful. How can I refine the snippet to more elixir-way(meaning more beautiful logic)?
{{:total, total}, {:processes, processes}, {:processes_used, processes_used}, {:system, system}, {:atom, atom}, {:atom_used, atom_used}, {:binary, binary}, {:code, code}, {:ets, ets}} =
:erlang.memory()
|> List.to_tuple()
params = %{
total: total,
processes: processes,
}