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 α β σ)
    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
      @[instance_reducible]
      instance Lean.PersistentHashMap.instInhabitedNode {α : Type u_1} {β : Type u_2} :
      Inhabited (Node α β)
      @[reducible, inline]
      Instances For
        @[reducible, inline]
        Instances For
          @[reducible, inline]
          Instances For
            @[reducible, inline]
            Instances For
              def Lean.PersistentHashMap.mkEmptyEntriesArray {α : Type u_1} {β : Type u_2} :
              Array (Entry α β (Node α β))
              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)
                  Instances For
                    def Lean.PersistentHashMap.empty {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] :
                    Instances For
                      def Lean.PersistentHashMap.isEmpty {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} :
                      Instances For
                        @[instance_reducible]
                        instance Lean.PersistentHashMap.instInhabited {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] :
                        def Lean.PersistentHashMap.mkEmptyEntries {α : Type u_1} {β : Type u_2} :
                        Node α β
                        Instances For
                          @[reducible, inline]
                          Instances For
                            @[reducible, inline]
                            Instances For
                              @[reducible, inline]
                              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)
                                  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)
                                      Instances For
                                        partial def Lean.PersistentHashMap.insertAtCollisionNodeAux {α : Type u_1} {β : Type u_2} [BEq α] :
                                        CollisionNode α β → Nat → α → β → CollisionNode α β
                                        def Lean.PersistentHashMap.insertAtCollisionNode {α : Type u_1} {β : Type u_2} [BEq α] :
                                        CollisionNode α β → α → β → CollisionNode α β
                                        Instances For
                                          Instances For
                                            def Lean.PersistentHashMap.mkCollisionNode {α : Type u_1} {β : Type u_2} (k₁ : α) (v₁ : β) (k₂ : α) (v₂ : β) :
                                            Node α β
                                            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 α β
                                              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 β
                                                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
                                                  @[inline]
                                                  def Lean.PersistentHashMap.findD {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) (a : α) (b₀ : β) :
                                                  β
                                                  Instances For
                                                    @[inline]
                                                    def Lean.PersistentHashMap.find! {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} [Inhabited β] (m : PersistentHashMap α β) (a : α) :
                                                    β
                                                    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 (α × β)
                                                      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₀

                                                        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
                                                          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 (α × β)
                                                            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 α β
                                                              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 α β
                                                                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 σ
                                                                  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) :
                                                                    Instances For
                                                                      def Lean.PersistentHashMap.foldl {σ : Type w} {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (map : PersistentHashMap α β) (f : σ → α → β → σ) (init : σ) :
                                                                      σ
                                                                      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.

                                                                        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 σ
                                                                          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 α β) (α × β)
                                                                            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 σ) :
                                                                            Instances For
                                                                              def Lean.PersistentHashMap.map {α : Type u} {β : Type v} {σ : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} (pm : PersistentHashMap α β) (f : β → σ) :
                                                                              Instances For
                                                                                def Lean.PersistentHashMap.toList {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) :
                                                                                List (α × β)
                                                                                Instances For
                                                                                  def Lean.PersistentHashMap.toArray {α : Type u_1} {β : Type u_2} {x✝ : BEq α} {x✝¹ : Hashable α} (m : PersistentHashMap α β) :
                                                                                  Array (α × β)
                                                                                  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 α β) :
                                                                                      Instances For