I think I need to wait on @Lucassifoni‘s work to get merged before submitting a PR for :sets.to_list/1. I’ve encountered a certain wrinkle with consistency tests, and I’m not sure what approach to take. Specifically, Erlang sets may contain any data type for its keys, and treats them uniquely.
> :sets.from_list(["a", 3, "3", false], [{:version, 2}])
%{3 => [], false => [], "3" => [], "a" => []}
> :sets.to_list(:sets.from_list(["a", 3, "3", false], [{:version, 2}]))
[3, false, "3", "a"]
But, of course, JavaScript coerces all of its object keys to strings and clobbers '3’ and 3.
> const set = { 3: [], '3': [], false: [], 'a': [] }
{ '3': [], false: [], a: [] }
> Object.keys(set)
[ '3', 'false', 'a' ]
Ouch. ![]()






















