mapValues


Description:

public static HashMap<K,U> mapValues<K,V,U> (HashMap<K,V> map, owned MapFunc<V,U> fn, HashFunc<K> hash_func, EqualFunc<K> equal_func)

Returns a new map with transformed values and preserved keys.

Parameters:

map

the source map.

fn

value transformation function.

hash_func

hash function for key type K.

equal_func

equality function for key type K.

Returns:

a new map with transformed values.