Module tql_maps

Function Index

map_values/2Map a function over the values of a map.
merge_with/3Merge 2 maps, using the specificied Combine function for identical keys.
merge_with3/4Merge 3 maps, using the specified Combine function for clashing keys.
update_key/3Replace a key in a map with another key.

Function Details

map_values/2

map_values(F::fun((V) -> V), M::#{K => V}) -> #{K => V}

Map a function over the values of a map.

merge_with/3

merge_with(Combine, Map, Map) -> Map

Merge 2 maps, using the specificied Combine function for identical keys.

When a key exists in both maps, Combine is called with the values for the first and second map, using the result in the resulting map.

merge_with3/4

merge_with3(Combine, Map, Map, Map) -> Map

Merge 3 maps, using the specified Combine function for clashing keys.

If a key exists in all three maps, Combine will first be called with the values from the first and second map, then with the result of that call and the value from the third map.

update_key/3

update_key(OldKey, NewKey, Map) -> UpdatedMap

Replace a key in a map with another key.

If the new key already exists, its value will be replaced with the value that used to be asociated with OldKey.


Generated by EDoc