Documentation

Lean.Data.PrefixTree

inductive Lean.PrefixTreeNode (α : Type u) (β : Type v) :
Type (max u v)
Instances For
    Equations
    def Lean.PrefixTreeNode.empty {α : Type u_1} {β : Type u_2} :
    Equations
    Instances For
      @[specialize #[]]
      def Lean.PrefixTreeNode.insert {α : Type u_1} {β : Type u_2} (t : Lean.PrefixTreeNode α β) (cmp : α → α → Ordering) (k : List α) (val : β) :
      Equations
      Instances For
        partial def Lean.PrefixTreeNode.insert.insertEmpty {α : Type u_1} {β : Type u_2} (val : β) (k : List α) :
        partial def Lean.PrefixTreeNode.insert.loop {α : Type u_1} {β : Type u_2} (cmp : α → α → Ordering) (val : β) :
        @[specialize #[]]
        def Lean.PrefixTreeNode.find? {α : Type u_1} {β : Type u_2} (t : Lean.PrefixTreeNode α β) (cmp : α → α → Ordering) (k : List α) :
        Equations
        Instances For
          partial def Lean.PrefixTreeNode.find?.loop {α : Type u_1} {β : Type u_2} (cmp : α → α → Ordering) :
          Lean.PrefixTreeNode α β → List α → Option β
          @[specialize #[]]
          def Lean.PrefixTreeNode.foldMatchingM {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {σ : Type u_1} [Monad m] (t : Lean.PrefixTreeNode α β) (cmp : α → α → Ordering) (k : List α) (init : σ) (f : β → σ → m σ) :
          m σ
          Equations
          Instances For
            partial def Lean.PrefixTreeNode.foldMatchingM.fold {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {σ : Type u_1} [Monad m] (f : β → σ → m σ) :
            Lean.PrefixTreeNode α β → σ → m σ
            partial def Lean.PrefixTreeNode.foldMatchingM.find {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {σ : Type u_1} [Monad m] (cmp : α → α → Ordering) (init : σ) (f : β → σ → m σ) :
            List α → Lean.PrefixTreeNode α β → σ → m σ
            inductive Lean.PrefixTreeNode.WellFormed {α : Type u_1} (cmp : α → α → Ordering) {β : Type u_2} :
            Instances For
              def Lean.PrefixTree (α : Type u) (β : Type v) (cmp : α → α → Ordering) :
              Type (max u v)
              Equations
              Instances For
                def Lean.PrefixTree.empty {α : Type u_1} {β : Type u_2} {p : α → α → Ordering} :
                Equations
                • Lean.PrefixTree.empty = ⟨Lean.PrefixTreeNode.empty, ⋯⟩
                Instances For
                  instance Lean.instInhabitedPrefixTree {α : Type u_1} {β : Type u_2} {p : α → α → Ordering} :
                  Equations
                  • Lean.instInhabitedPrefixTree = { default := Lean.PrefixTree.empty }
                  instance Lean.instEmptyCollectionPrefixTree {α : Type u_1} {β : Type u_2} {p : α → α → Ordering} :
                  Equations
                  • Lean.instEmptyCollectionPrefixTree = { emptyCollection := Lean.PrefixTree.empty }
                  @[inline]
                  def Lean.PrefixTree.insert {α : Type u_1} {β : Type u_2} {p : α → α → Ordering} (t : Lean.PrefixTree α β p) (k : List α) (v : β) :
                  Equations
                  • t.insert k v = ⟨t.val.insert p k v, ⋯⟩
                  Instances For
                    @[inline]
                    def Lean.PrefixTree.find? {α : Type u_1} {β : Type u_2} {p : α → α → Ordering} (t : Lean.PrefixTree α β p) (k : List α) :
                    Equations
                    • t.find? k = t.val.find? p k
                    Instances For
                      @[inline]
                      def Lean.PrefixTree.foldMatchingM {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {p : α → α → Ordering} {σ : Type u_1} [Monad m] (t : Lean.PrefixTree α β p) (k : List α) (init : σ) (f : β → σ → m σ) :
                      m σ
                      Equations
                      • t.foldMatchingM k init f = t.val.foldMatchingM p k init f
                      Instances For
                        @[inline]
                        def Lean.PrefixTree.foldM {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {p : α → α → Ordering} {σ : Type u_1} [Monad m] (t : Lean.PrefixTree α β p) (init : σ) (f : β → σ → m σ) :
                        m σ
                        Equations
                        • t.foldM init f = t.foldMatchingM [] init f
                        Instances For
                          @[inline]
                          def Lean.PrefixTree.forMatchingM {m : Type → Type u_1} {α : Type u_2} {β : Type u_3} {p : α → α → Ordering} [Monad m] (t : Lean.PrefixTree α β p) (k : List α) (f : β → m Unit) :
                          Equations
                          • t.forMatchingM k f = t.val.foldMatchingM p k () fun (b : β) (x : Unit) => f b
                          Instances For
                            @[inline]
                            def Lean.PrefixTree.forM {m : Type → Type u_1} {α : Type u_2} {β : Type u_3} {p : α → α → Ordering} [Monad m] (t : Lean.PrefixTree α β p) (f : β → m Unit) :
                            Equations
                            • t.forM f = t.forMatchingM [] f
                            Instances For