Documentation

Lean.Data.PersistentHashMap

inductive Lean.PersistentHashMap.Entry (α : Type u) (β : Type v) (σ : Type w) :
Type (max (max u v) w)
Instances For
    @[instance_reducible]
    instance Lean.PersistentHashMap.instInhabitedEntry {α : Type u_1} {β : Type u_2} {σ : Type u_3} :
    Inhabited (Entry α β σ)
    Equations
    inductive Lean.PersistentHashMap.Node (α : Type u) (β : Type v) :
    Type (max u v)
    Instances For
      partial def Lean.PersistentHashMap.Node.isEmpty {α : Type u_1} {β : Type u_2} :
      Node α β → Bool
      @[reducible, inline]
      Equations
      Instances For
        @[reducible, inline]
        Equations
        Instances For
          structure Lean.PersistentHashMap (α : Type u) (β : Type v) [BEq α] [Hashable α] :
          Type (max u v)
          Instances For
            @[reducible, inline]
            abbrev Lean.PHashMap (α : Type u) (β : Type v) [BEq α] [Hashable α] :
            Type (max u v)
            Equations
            Instances For
              def Lean.PersistentHashMap.empty {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] :
              Equations
              Instances For
                def Lean.PersistentHashMap.isEmpty {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                Equations
                Instances For
                  @[instance_reducible]
                  instance Lean.PersistentHashMap.instInhabited {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] :
                  Equations
                  @[reducible, inline]
                  Equations
                  Instances For
                    @[reducible, inline]
                    Equations
                    Instances For
                      @[reducible, inline]
                      Equations
                      Instances For
                        inductive Lean.PersistentHashMap.IsCollisionNode {α : Type u_1} {β : Type u_2} :
                        Node α β → Prop
                        Instances For
                          @[reducible, inline]
                          abbrev Lean.PersistentHashMap.CollisionNode (α : Type u_1) (β : Type u_2) :
                          Type (max 0 u_2 u_1)
                          Equations
                          Instances For
                            inductive Lean.PersistentHashMap.IsEntriesNode {α : Type u_1} {β : Type u_2} :
                            Node α β → Prop
                            Instances For
                              @[reducible, inline]
                              abbrev Lean.PersistentHashMap.EntriesNode (α : Type u_1) (β : Type u_2) :
                              Type (max 0 u_2 u_1)
                              Equations
                              Instances For
                                partial def Lean.PersistentHashMap.insertAtCollisionNodeAux {α : Type u_1} {β : Type u_2} [BEq α] :
                                CollisionNode α β → Nat → α → β → CollisionNode α β
                                def Lean.PersistentHashMap.mkCollisionNode {α : Type u_1} {β : Type u_2} (k₁ : α) (v₁ : β) (k₂ : α) (v₂ : β) :
                                Node α β
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  partial def Lean.PersistentHashMap.insertAux {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] :
                                  Node α β → USize → USize → α → β → Node α β
                                  def Lean.PersistentHashMap.insert {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                                  PersistentHashMap α β → α → β → PersistentHashMap α β
                                  Equations
                                  Instances For
                                    partial def Lean.PersistentHashMap.findAtAux {α : Type u_1} {β : Type u_2} [BEq α] (keys : Array α) (vals : Array β) (heq : keys.size = vals.size) (i : Nat) (k : α) :
                                    partial def Lean.PersistentHashMap.findAux {α : Type u_1} {β : Type u_2} [BEq α] :
                                    Node α β → USize → α → Option β
                                    def Lean.PersistentHashMap.find? {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                                    PersistentHashMap α β → α → Option β
                                    Equations
                                    Instances For
                                      @[instance_reducible]
                                      instance Lean.PersistentHashMap.instGetElemOptionTrue {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                                      GetElem (PersistentHashMap α β) α (Option β) fun (x : PersistentHashMap α β) (x_1 : α) => True
                                      Equations
                                      @[inline]
                                      def Lean.PersistentHashMap.findD {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) (a : α) (b₀ : β) :
                                      β
                                      Equations
                                      Instances For
                                        @[inline]
                                        def Lean.PersistentHashMap.find! {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} [Inhabited β] (m : PersistentHashMap α β) (a : α) :
                                        β
                                        Equations
                                        Instances For
                                          partial def Lean.PersistentHashMap.findEntryAtAux {α : Type u_1} {β : Type u_2} [BEq α] (keys : Array α) (vals : Array β) (heq : keys.size = vals.size) (i : Nat) (k : α) :
                                          Option (α × β)
                                          partial def Lean.PersistentHashMap.findEntryAux {α : Type u_1} {β : Type u_2} [BEq α] :
                                          Node α β → USize → α → Option (α × β)
                                          def Lean.PersistentHashMap.findEntry? {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                                          PersistentHashMap α β → α → Option (α × β)
                                          Equations
                                          Instances For
                                            partial def Lean.PersistentHashMap.findKeyDAtAux {α : Type u_1} {β : Type u_2} [BEq α] (keys : Array α) (vals : Array β) (heq : keys.size = vals.size) (i : Nat) (k k₀ : α) :
                                            α
                                            partial def Lean.PersistentHashMap.findKeyDAux {α : Type u_1} {β : Type u_2} [BEq α] :
                                            Node α β → USize → α → α → α
                                            @[inline]
                                            def Lean.PersistentHashMap.findKeyD {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) (a a₀ : α) :
                                            α

                                            A more efficient m.findEntry? a |>.map (·.1) |>.getD a₀

                                            Equations
                                            Instances For
                                              partial def Lean.PersistentHashMap.containsAtAux {α : Type u_1} {β : Type u_2} [BEq α] (keys : Array α) (vals : Array β) (heq : keys.size = vals.size) (i : Nat) (k : α) :
                                              partial def Lean.PersistentHashMap.containsAux {α : Type u_1} {β : Type u_2} [BEq α] :
                                              Node α β → USize → α → Bool
                                              def Lean.PersistentHashMap.contains {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] :
                                              PersistentHashMap α β → α → Bool
                                              Equations
                                              Instances For
                                                partial def Lean.PersistentHashMap.isUnaryEntries {α : Type u_1} {β : Type u_2} (a : Array (Entry α β (Node α β))) (i : Nat) (acc : Option (α × β)) :
                                                Option (α × β)
                                                def Lean.PersistentHashMap.isUnaryNode {α : Type u_1} {β : Type u_2} :
                                                Node α β → Option (α × β)
                                                Equations
                                                Instances For
                                                  partial def Lean.PersistentHashMap.eraseAux {α : Type u_1} {β : Type u_2} [BEq α] :
                                                  Node α β → USize → α → Node α β
                                                  def Lean.PersistentHashMap.erase {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                                                  PersistentHashMap α β → α → PersistentHashMap α β
                                                  Equations
                                                  Instances For
                                                    @[specialize #[]]
                                                    partial def Lean.PersistentHashMap.alterAux {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] (f : Option β → Option β) :
                                                    Node α β → USize → USize → α → Node α β
                                                    @[inline]
                                                    def Lean.PersistentHashMap.alter {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                                                    PersistentHashMap α β → α → (Option β → Option β) → PersistentHashMap α β
                                                    Equations
                                                    Instances For
                                                      partial def Lean.PersistentHashMap.foldlMAux {m : Type w → Type w'} [Monad m] {σ : Type w} {α : Type u_1} {β : Type u_2} (f : σ → α → β → m σ) :
                                                      Node α β → σ → m σ
                                                      def Lean.PersistentHashMap.foldlM {m : Type w → Type w'} [Monad m] {σ : Type w} {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (map : PersistentHashMap α β) (f : σ → α → β → m σ) (init : σ) :
                                                      m σ
                                                      Equations
                                                      Instances For
                                                        def Lean.PersistentHashMap.forM {m : Type w → Type w'} [Monad m] {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (map : PersistentHashMap α β) (f : α → β → m PUnit) :
                                                        Equations
                                                        Instances For
                                                          def Lean.PersistentHashMap.foldl {σ : Type w} {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (map : PersistentHashMap α β) (f : σ → α → β → σ) (init : σ) :
                                                          σ
                                                          Equations
                                                          • map.foldl f init = (map.foldlM (fun (x1 : σ) (x2 : α) (x3 : β) => pure (f x1 x2 x3)) init).run
                                                          Instances For
                                                            @[implemented_by _private.Lean.Data.PersistentHashMap.0.Lean.PersistentHashMap.foldlNewEntriesUnsafe]
                                                            def Lean.PersistentHashMap.foldlNewEntries {σ : Type w} {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (f : σ → α → β → σ) (new old : PersistentHashMap α β) (init : σ) :
                                                            σ

                                                            Folds f over the entries of new whose keys are not in old, in the order of foldl. If new was derived from old by insertions, the cost is proportional to the number of insertions rather than to the size of new.

                                                            Equations
                                                            Instances For
                                                              def Lean.PersistentHashMap.forIn {m : Type w → Type w'} {σ : Type w} {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} [Monad m] (map : PersistentHashMap α β) (init : σ) (f : α × β → σ → m (ForInStep σ)) :
                                                              m σ
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                @[instance_reducible]
                                                                instance Lean.PersistentHashMap.instForInProdOfMonad {m : Type w → Type w'} {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} [Monad m] :
                                                                ForIn m (PersistentHashMap α β) (α × β)
                                                                Equations
                                                                partial def Lean.PersistentHashMap.mapMAux {α : Type u} {β : Type v} {σ : Type u} {m : Type u → Type w} [Monad m] (f : β → m σ) (n : Node α β) :
                                                                m (Node α σ)
                                                                def Lean.PersistentHashMap.mapM {α : Type u} {β : Type v} {σ : Type u} {m : Type u → Type w} [Monad m] {x✝ : BEq α} {x✝¹ : Hashable α} (pm : PersistentHashMap α β) (f : β → m σ) :
                                                                Equations
                                                                Instances For
                                                                  def Lean.PersistentHashMap.map {α : Type u} {β : Type v} {σ : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (pm : PersistentHashMap α β) (f : β → σ) :
                                                                  Equations
                                                                  Instances For
                                                                    def Lean.PersistentHashMap.toList {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) :
                                                                    List (α × β)
                                                                    Equations
                                                                    Instances For
                                                                      def Lean.PersistentHashMap.toArray {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) :
                                                                      Array (α × β)
                                                                      Equations
                                                                      Instances For
                                                                        • numNodes : Nat
                                                                        • numNull : Nat
                                                                        • numCollisions : Nat
                                                                        • maxDepth : Nat
                                                                        Instances For
                                                                          partial def Lean.PersistentHashMap.collectStats {α : Type u_1} {β : Type u_2} :
                                                                          Node α β → Stats → Nat → Stats
                                                                          def Lean.PersistentHashMap.stats {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) :
                                                                          Equations
                                                                          Instances For
                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For