# Documentation

Std.Lean.PersistentHashMap

def Lean.PersistentHashMap.insert' {α : Type u_1} [inst : BEq α] [inst : ] {β : Type u_2} (m : ) (a : α) (b : β) :

Similar to insert, but also returns a Boolean flag indicating whether an existing entry has been replaced with a ↦ b↦ b.

Equations
• = let oldSize := m.size; let m := ; (m, m.size == oldSize)
def Lean.PersistentHashMap.toArray {α : Type u_1} [inst : BEq α] [inst : ] {β : Type u_2} (m : ) :
Array (α × β)

Turns a PersistentHashMap into an array of key-value pairs.

Equations
def Lean.PersistentHashMap.ofList {α : Type u_1} [inst : BEq α] [inst : ] {β : Type u_2} (xs : List (α × β)) :

Builds a PersistentHashMap from a list of key-value pairs. Values of duplicated keys are replaced by their respective last occurrences.

Equations
• One or more equations did not get rendered due to their size.
def Lean.PersistentHashMap.ofListWith {α : Type u_1} [inst : BEq α] [inst : ] {β : Type u_2} (xs : List (α × β)) (f : αβββ) :

Variant of ofList which accepts a function that combines values of duplicated keys.

Equations
• One or more equations did not get rendered due to their size.
def Lean.PersistentHashMap.ofArray {α : Type u_1} [inst : BEq α] [inst : ] {β : Type u_2} (xs : Array (α × β)) :

Builds a PersistentHashMap from an array of key-value pairs. Values of duplicated keys are replaced by their respective last occurrences.

Equations
• One or more equations did not get rendered due to their size.
def Lean.PersistentHashMap.ofArrayWith {α : Type u_1} [inst : BEq α] [inst : ] {β : Type u_2} (xs : Array (α × β)) (f : αβββ) :

Variant of ofArray which accepts a function that combines values of duplicated keys.

Equations
• One or more equations did not get rendered due to their size.
@[specialize #[]]
def Lean.PersistentHashMap.mergeWithM {α : Type u_1} [inst : BEq α] [inst : ] {m : Type (maxu_2u_1) → Type u_3} {β : Type (maxu_2u_1)} [inst : ] (self : ) (other : ) (f : αββm β) :
m ()

Merge two PersistentHashMaps. The values of keys which appear in both maps are combined using the monadic function f.

Equations
• One or more equations did not get rendered due to their size.
@[inline]
def Lean.PersistentHashMap.mergeWith {α : Type u_1} [inst : BEq α] [inst : ] {β : Type u_2} (self : ) (other : ) (f : αβββ) :

Merge two PersistentHashMaps. The values of keys which appear in both maps are combined using f.

Equations
• One or more equations did not get rendered due to their size.