Documentation

Lake.Toml.Data.Dict

Red-Black Dictionary #

Defines an insertion-ordered key-value mapping backed by an red-black tree. Implemented via a key-index RBMap into an Array of key-value pairs.

structure Lake.Toml.RBDict (α : Type u) (β : Type v) (cmp : ααOrdering) :
Type (max u v)
Instances For
    instance Lake.Toml.instInhabitedRBDict {a✝ : Type u_1} {a✝¹ : Type u_2} {a✝² : a✝a✝Ordering} :
    Inhabited (RBDict a✝ a✝¹ a✝²)
    Equations
      @[reducible, inline]
      abbrev Lake.Toml.NameDict (α : Type u) :
      Equations
        Instances For
          def Lake.Toml.RBDict.empty {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
          RBDict α β cmp
          Equations
            Instances For
              instance Lake.Toml.RBDict.instEmptyCollection {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
              Equations
                def Lake.Toml.RBDict.mkEmpty {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (capacity : Nat) :
                RBDict α β cmp
                Equations
                  Instances For
                    def Lake.Toml.RBDict.ofArray {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (items : Array (α × β)) :
                    RBDict α β cmp
                    Equations
                      Instances For
                        def Lake.Toml.RBDict.beq {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} [BEq (α × β)] (self other : RBDict α β cmp) :
                        Equations
                          Instances For
                            instance Lake.Toml.RBDict.instBEqOfProd {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} [BEq (α × β)] :
                            BEq (RBDict α β cmp)
                            Equations
                              @[reducible, inline]
                              abbrev Lake.Toml.RBDict.size {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (t : RBDict α β cmp) :
                              Equations
                                Instances For
                                  @[reducible, inline]
                                  abbrev Lake.Toml.RBDict.isEmpty {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (t : RBDict α β cmp) :
                                  Equations
                                    Instances For
                                      def Lake.Toml.RBDict.keys {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (t : RBDict α β cmp) :
                                      Equations
                                        Instances For
                                          def Lake.Toml.RBDict.values {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (t : RBDict α β cmp) :
                                          Equations
                                            Instances For
                                              def Lake.Toml.RBDict.contains {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (k : α) (t : RBDict α β cmp) :
                                              Equations
                                                Instances For
                                                  def Lake.Toml.RBDict.findIdx? {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (k : α) (t : RBDict α β cmp) :
                                                  Equations
                                                    Instances For
                                                      def Lake.Toml.RBDict.findEntry? {α β : Type} {cmp : ααOrdering} (k : α) (t : RBDict α β cmp) :
                                                      Option (α × β)
                                                      Equations
                                                        Instances For
                                                          @[inline]
                                                          def Lake.Toml.RBDict.find? {α β : Type} {cmp : ααOrdering} (k : α) (t : RBDict α β cmp) :
                                                          Equations
                                                            Instances For
                                                              def Lake.Toml.RBDict.push {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (k : α) (v : β) (t : RBDict α β cmp) :
                                                              RBDict α β cmp
                                                              Equations
                                                                Instances For
                                                                  @[specialize #[]]
                                                                  def Lake.Toml.RBDict.alter {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (k : α) (f : Option ββ) (t : RBDict α β cmp) :
                                                                  RBDict α β cmp
                                                                  Equations
                                                                    Instances For
                                                                      def Lake.Toml.RBDict.insert {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (k : α) (v : β) (t : RBDict α β cmp) :
                                                                      RBDict α β cmp
                                                                      Equations
                                                                        Instances For
                                                                          @[macro_inline]
                                                                          def Lake.Toml.RBDict.insertIf {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (p : Bool) (k : α) (v : β) (t : RBDict α β cmp) :
                                                                          RBDict α β cmp

                                                                          Inserts the value into the dictionary if p is true.

                                                                          Equations
                                                                            Instances For
                                                                              @[macro_inline]
                                                                              def Lake.Toml.RBDict.insertUnless {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (p : Bool) (k : α) (v : β) (t : RBDict α β cmp) :
                                                                              RBDict α β cmp

                                                                              Inserts the value into the dictionary if p is false.

                                                                              Equations
                                                                                Instances For
                                                                                  @[macro_inline]
                                                                                  def Lake.Toml.RBDict.insertSome {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (k : α) (v? : Option β) (t : RBDict α β cmp) :
                                                                                  RBDict α β cmp

                                                                                  Insert the value into the dictionary if it is not none.

                                                                                  Equations
                                                                                    Instances For
                                                                                      def Lake.Toml.RBDict.appendArray {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (self : RBDict α β cmp) (other : Array (α × β)) :
                                                                                      RBDict α β cmp
                                                                                      Equations
                                                                                        Instances For
                                                                                          instance Lake.Toml.RBDict.instHAppendArrayProd {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
                                                                                          HAppend (RBDict α β cmp) (Array (α × β)) (RBDict α β cmp)
                                                                                          Equations
                                                                                            @[inline]
                                                                                            def Lake.Toml.RBDict.append {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (self other : RBDict α β cmp) :
                                                                                            RBDict α β cmp
                                                                                            Equations
                                                                                              Instances For
                                                                                                instance Lake.Toml.RBDict.instAppend {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
                                                                                                Append (RBDict α β cmp)
                                                                                                Equations
                                                                                                  @[inline]
                                                                                                  def Lake.Toml.RBDict.map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {cmp : ααOrdering} (f : αβγ) (t : RBDict α β cmp) :
                                                                                                  RBDict α γ cmp
                                                                                                  Equations
                                                                                                    Instances For
                                                                                                      @[inline]
                                                                                                      def Lake.Toml.RBDict.filter {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (p : αβBool) (t : RBDict α β cmp) :
                                                                                                      RBDict α β cmp
                                                                                                      Equations
                                                                                                        Instances For
                                                                                                          @[inline]
                                                                                                          def Lake.Toml.RBDict.filterMap {α : Type u_1} {β : Type u_2} {γ : Type u_3} {cmp : ααOrdering} (f : αβOption γ) (t : RBDict α β cmp) :
                                                                                                          RBDict α γ cmp
                                                                                                          Equations
                                                                                                            Instances For
                                                                                                              @[inline]
                                                                                                              def Lake.Toml.RBDict.foldM {m : Type u_1 → Type u_2} {σ : Type u_1} {α : Type u_3} {β : Type u_4} {cmp : ααOrdering} [Monad m] (f : σαβm σ) (init : σ) (t : RBDict α β cmp) :
                                                                                                              m σ
                                                                                                              Equations
                                                                                                                Instances For
                                                                                                                  @[inline]
                                                                                                                  def Lake.Toml.RBDict.fold {σ : Type u_1} {α : Type u_2} {β : Type u_3} {cmp : ααOrdering} (f : σαβσ) (init : σ) (t : RBDict α β cmp) :
                                                                                                                  σ
                                                                                                                  Equations
                                                                                                                    Instances For