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.
Equations
- Cedar.Data.instReprMap = { reprPrec := Cedar.Data.instReprMap.repr }
def
Cedar.Data.instReprMap.repr
{α✝ : Type u_1}
{β✝ : Type u_2}
[Repr α✝]
[Repr β✝]
:
Map α✝ β✝ → Nat → Std.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 α✝ β✝)
:
Equations
- Cedar.Data.instDecidableEqMap.decEq (Cedar.Data.Map.mk a) (Cedar.Data.Map.mk b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
instance
Cedar.Data.instDecidableEqMap
{α✝ : Type u_1}
{β✝ : Type u_2}
[DecidableEq α✝]
[DecidableEq β✝]
:
DecidableEq (Map α✝ β✝)
Instances For
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
Empty map
Equations
Instances For
Filters m using f.
Equations
- Cedar.Data.Map.filter f m = Cedar.Data.Map.mk (List.filter (fun (x : α × β) => match x with | (k, v) => f k v) m.toList)
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
Equations
Instances For
Equations
- Cedar.Data.Map.instLTOfProd = { lt := fun (a b : Cedar.Data.Map α β) => a.1 < b.1 }
instance
Cedar.Data.Map.decLt
{α : Type u_1}
{β : Type u_2}
[LT (α × β)]
[DecidableEq (α × β)]
[DecidableLT (α × β)]
(n m : Map α β)
:
Equations
- (Cedar.Data.Map.mk nkvs).decLt (Cedar.Data.Map.mk mkvs) = nkvs.decidableLT mkvs
Equations
- Cedar.Data.Map.instMembership = { mem := fun (m : Cedar.Data.Map α β) (a : α) => List.Mem a (List.map Prod.fst m.toList) }
instance
Cedar.Data.Map.instHAppendOfDecidableLT
{α : Type u_1}
{β : Type u_2}
[LT α]
[DecidableLT α]
:
Equations
- Cedar.Data.Map.instHAppendOfDecidableLT = { hAppend := fun (a b : Cedar.Data.Map α β) => Cedar.Data.Map.make (a.toList ++ b.toList) }