Pudu programming language
Menu
API reference

Std.BiMap.insert

1 declaration

fn

insert: &Std.BiMap.BiMap[L, R] -> L -> R -> Std.BiMap.BiMap[L, R]

This is a callable function.

What it does

The map with a pair added, displacing whatever either side was paired with.

Both sides are removed from their old pairings first, so the two directions

cannot end up disagreeing. Adding b -> 1 to a map already holding a -> 1

leaves only b -> 1: the map has the same number of pairs it started with

rather than one more.

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.BiMapSearch related declarations