maps:from_list seems to preserve the reverse of the order of the list. This example is from the docs:
List = [{"a",ignored},{1337,"value two"},{42,value_three},{"a",1}],
maps:from_list(List).
Is this behavior guaranteed?
maps:from_list seems to preserve the reverse of the order of the list. This example is from the docs:
List = [{"a",ignored},{1337,"value two"},{42,value_three},{"a",1}],
maps:from_list(List).
Is this behavior guaranteed?
"Preserve the reverse order of the list" isn't really accurate, since that would mean the map would somehow present that order, and it won't do that. I think what you're really asking about is whether values associated with keys that appear later in the list are stored in the map, effectively dropping those that appear earlier in the list; if so, the maps:from_list/1 documentation provides the following guarantee:
If the same key appears more than once, the latter (right-most) value is used and the previous values are ignored.