Documentation

Lean.Data.Iterators.Producers.PersistentHashMap

PersistentHashMap iterator #

This module provides an iterator for Lean.PersistentHashMap that is accessible via Lean.PersistentHashMap.iter.

inductive Lean.PersistentHashMap.Zipper (α : Type u) (β : Type v) :
Type (max u v)

A zipper for traversing a PersistentHashMap. This is an inductive structure representing the remaining key-value pairs to yield.

Instances For
    def Lean.PersistentHashMap.Zipper.prependNode {α : Type u_1} {β : Type u_2} (node : Node α β) (z : Zipper α β) :
    Zipper α β
    Equations
    Instances For
      @[inline]
      def Lean.PersistentHashMap.Zipper.step {α : Type u_1} {β : Type u_2} (it : Std.IterM Id (α × β)) :
      Std.IterStep (Std.IterM Id (α × β)) (α × β)
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[implicit_reducible]
        instance Lean.PersistentHashMap.instIterator {α : Type u_1} {β : Type u_2} :
        Std.Iterator (Zipper α β) Id (α × β)
        Equations
        • One or more equations did not get rendered due to their size.
        @[irreducible]
        def Lean.PersistentHashMap.Node.measure {α : Type u_1} {β : Type u_2} (node : Node α β) :

        Counts the total number of entries reachable from a node, including nested children.

        Equations
        Instances For
          def Lean.PersistentHashMap.subarrayMeasure {α : Type u_1} {β : Type u_2} (es : Subarray (Entry α β (Node α β))) :

          Counts entries remaining in a subarray, including nested children.

          Equations
          Instances For
            def Lean.PersistentHashMap.Zipper.measure {α : Type u_1} {β : Type u_2} :
            Zipper α βNat

            Counts the total remaining work in a zipper, including entries nested in child nodes.

            Equations
            Instances For
              @[implicit_reducible, inline]
              instance Lean.PersistentHashMap.instIteratorLoop {α : Type u_1} {β : Type u_2} {n : Type u_3 → Type u_4} [Monad n] :
              Equations
              @[inline]
              def Lean.PersistentHashMap.iter {α : Type u_1} {β : Type u_2} [BEq α] [Hashable α] (map : PersistentHashMap α β) :
              Std.Iter (α × β)

              Returns a finite iterator over the key-value pairs of the given PersistentHashMap. The iteration order is unspecified.

              Termination properties:

              • Finite instance: always
              • Productive instance: always
              Equations
              Instances For