Documentation

Cedar.Data.Map

This file defines a simple map data types, backed by a sorted duplicate-free list of key-value. Functions maps assume but don't require that their inputs are well-formed (sorted and duplicate-free). Separate theorems show that these functions produce well-formed outputs when given well-formed inputs.

Use Map.make to construct well-formed maps from lists of key-value pairs.

inductive Cedar.Data.Map (α : Type u) (β : Type v) :
Type (max u v)
Instances For
    instance Cedar.Data.instReprMap {α✝ : Type u_1} {β✝ : Type u_2} [Repr α✝] [Repr β✝] :
    Repr (Map α✝ β✝)
    Equations
    def Cedar.Data.instReprMap.repr {α✝ : Type u_1} {β✝ : Type u_2} [Repr α✝] [Repr β✝] :
    Map α✝ β✝NatStd.Format
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Cedar.Data.instDecidableEqMap.decEq {α✝ : Type u_1} {β✝ : Type u_2} [DecidableEq α✝] [DecidableEq β✝] (x✝ x✝¹ : Map α✝ β✝) :
      Decidable (x✝ = x✝¹)
      Equations
      Instances For
        instance Cedar.Data.instInhabitedMap {a✝ : Type u_1} {a✝¹ : Type u_2} :
        Inhabited (Map a✝ a✝¹)
        Equations
        def Cedar.Data.Map.make {α : Type u_1} {β : Type u_2} [LT α] [DecidableLT α] (kvs : List (α × β)) :
        Map α β

        Creates a well-formed map from the given list of pairs.

        Equations
        Instances For
          def Cedar.Data.Map.empty {α : Type u_1} {β : Type u_2} :
          Map α β

          Empty map

          Equations
          Instances For
            def Cedar.Data.Map.toList {α : Type u} {β : Type v} (m : Map α β) :
            List (α × β)

            Returns an ordered and duplicate free list provided the given map is well-formed.

            Equations
            Instances For
              def Cedar.Data.Map.keys {α : Type u_1} {β : Type u_2} (m : Map α β) :
              Set α

              Returns the keys of m as a set.

              Equations
              Instances For
                def Cedar.Data.Map.values {α : Type u_1} {β : Type u_2} (m : Map α β) :
                List β

                Returns the values of m as a list.

                Equations
                Instances For
                  def Cedar.Data.Map.find? {α : Type u_1} {β : Type u_2} [BEq α] (m : Map α β) (k : α) :

                  Returns the binding for k in m, if any.

                  Equations
                  Instances For
                    def Cedar.Data.Map.contains {α : Type u_1} {β : Type u_2} [BEq α] (m : Map α β) (k : α) :

                    Returns true if m contains a mapping for the key k.

                    Equations
                    Instances For
                      def Cedar.Data.Map.findOrErr {α : Type u_1} {β : Type u_2} {ε : Type u_3} [BEq α] (m : Map α β) (k : α) (err : ε) :
                      Except ε β

                      Returns the binding for k in m or err if none is found.

                      Equations
                      Instances For
                        def Cedar.Data.Map.find! {α : Type u_1} {β : Type u_2} [Repr α] [BEq α] [Inhabited β] (m : Map α β) (k : α) :
                        β

                        Returns the binding for k in m, or panics if none is found.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Cedar.Data.Map.filter {α : Type u_1} {β : Type u_2} (f : αβBool) (m : Map α β) :
                          Map α β

                          Filters m using f.

                          Equations
                          Instances For
                            def Cedar.Data.Map.size {α : Type u_1} {β : Type u_2} (m : Map α β) :
                            Equations
                            Instances For
                              def Cedar.Data.Map.mapOnValues {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : βγ) (m : Map α β) :
                              Map α γ
                              Equations
                              Instances For
                                def Cedar.Data.Map.mapOnKeys {α : Type u_1} {β : Type u_2} {γ : Type u_3} [LT γ] [DecidableLT γ] (f : αγ) (m : Map α β) :
                                Map γ β
                                Equations
                                Instances For
                                  def Cedar.Data.Map.mapMOnValues {m : Type (max u_1 u_2) → Type u_3} {α : Type u_2} {β : Type u_4} {γ : Type (max u_1 u_2)} [LT α] [DecidableLT α] [Monad m] (f : βm γ) (map : Map α β) :
                                  m (Map α γ)
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def Cedar.Data.Map.mapMOnKeys {m : Type (max u_1 u_2) → Type u_3} {α : Type u_4} {β : Type u_2} {γ : Type (max u_1 u_2)} [LT γ] [DecidableLT γ] [Monad m] (f : αm γ) (map : Map α β) :
                                    m (Map γ β)
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def Cedar.Data.Map.mapOnValues₂ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [SizeOf α] [SizeOf β] (m : Map α β) (f : { x : β // sizeOf x < sizeOf m }γ) :
                                      Map α γ
                                      Equations
                                      Instances For
                                        def Cedar.Data.Map.mapMOnValues₂ {m : Type (max u_1 u_2) → Type u_3} {α : Type u_2} {β : Type u_4} {γ : Type (max u_1 u_2)} [SizeOf α] [SizeOf β] [Monad m] (map : Map α β) (f : { x : β // sizeOf x < sizeOf map }m γ) :
                                        m (Map α γ)
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          def Cedar.Data.Map.wellFormed {α : Type u_1} {β : Type u_2} [LT α] [DecidableLT α] (m : Map α β) :
                                          Equations
                                          Instances For
                                            instance Cedar.Data.Map.instLTOfProd {α : Type u_1} {β : Type u_2} [LT (α × β)] :
                                            LT (Map α β)
                                            Equations
                                            instance Cedar.Data.Map.decLt {α : Type u_1} {β : Type u_2} [LT (α × β)] [DecidableEq (α × β)] [DecidableLT (α × β)] (n m : Map α β) :
                                            Decidable (n < m)
                                            Equations
                                            instance Cedar.Data.Map.instMembership {α : Type u_1} {β : Type u_2} :
                                            Membership α (Map α β)
                                            Equations
                                            instance Cedar.Data.Map.instHAppendOfDecidableLT {α : Type u_1} {β : Type u_2} [LT α] [DecidableLT α] :
                                            HAppend (Map α β) (Map α β) (Map α β)
                                            Equations