Utilities for lists of sigmas #
This file includes several ways of interacting with List (Sigma β), treated as a key-value store.
If α : Type* and β : α → Type*, then we regard s : Sigma β as having key s.1 : α and value
s.2 : β s.1. Hence, List (Sigma β) behaves like a key-value store.
Main Definitions #
List.keysextracts the list of keys.List.NodupKeysdetermines if the store has duplicate keys.List.lookup/lookup_allaccesses the value(s) of a particular key.List.kreplacereplaces the first value with a given key by a given value.List.keraseremoves a value.List.kinsertinserts a value.List.kunioncomputes the union of two stores.List.kextractreturns a value with a given key and the rest of the values.
dlookup a l is the first value in l corresponding to the key a,
or none if no such element exists.
Equations
Instances For
lookup_all a l is the list of all values in l corresponding to the key a.
Equations
Instances For
Replaces the first value with key a by b.
Equations
Instances For
Remove the first pair with the key a.
Equations
Instances For
Alias of List.kerase_of_notMem_keys.
Alias of List.notMem_keys_kerase.
Insert the pair ⟨a, b⟩ and erase the first pair with the key a.
Equations
Instances For
Finds the first entry with a given key a and returns its value (as an Option because there
might be no entry with key a) alongside with the rest of the entries.