Skip to main content

Dictionary.map_with_key

map_with_keyfunction

Documentation

Maps a function over each key-value pair in the dictionary, transforming the value.

Arguments

  • function: Function to apply to each key and value in the dictionary, taking a key and a value and returning a value.

Examples

Prepend the keys to the values in the dictionary.

      import Standard.Examples

example_map_with_key =
Examples.dictionary.map_with_key (k -> v -> k.to_text + "-" + v)