Pudu programming language
Menu
API reference

Std.EnumMap.mergeWith

1 declaration

fn

mergeWith: &Std.EnumMap.EnumMap[K, V] -> &Std.EnumMap.EnumMap[K, V] -> fn(V, V) -> V -> Std.EnumMap.EnumMap[K, V]

This is a callable function.

What it does

Two maps over the same domain combined value by value.

The domain is the first map's. A key the second map lacks keeps the first

map's value untouched, so combining a full week with a partial one leaves

the untouched days alone rather than reporting a domain mismatch the caller

would have to handle on every call.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • & borrows a value for this call instead of moving or copying it.
  • Names inside [ ] are type arguments, such as the item type held by a collection.

Back to Std.EnumMapSearch related declarations