Compare two Key
s. The ordering is total but otherwise arbitrary. (It uses
Name.quickCmp
internally.)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.DiscrTree.Key.instOrdKey = { compare := Lean.Meta.DiscrTree.Key.cmp }
Monadically fold the keys and values stored in a Trie
.
Fold the keys and values stored in a Trie
.
Equations
- Lean.Meta.DiscrTree.Trie.fold initialKeys f init t = Id.run (Lean.Meta.DiscrTree.Trie.foldM initialKeys (fun s k a => pure (f s k a)) init t)
Instances For
Monadically fold the values stored in a Trie
.
Fold the values stored in a Trie
.
Equations
- Lean.Meta.DiscrTree.Trie.foldValues f init t = Id.run (Lean.Meta.DiscrTree.Trie.foldValuesM f init t)
Instances For
The number of values stored in a Trie
.
Merge two Trie
s. Duplicate values are preserved.
Auxiliary definition for mergePreservingDuplicates
.
Monadically fold over the keys and values stored in a DiscrTree
.
Equations
- Lean.Meta.DiscrTree.foldM f init t = Lean.PersistentHashMap.foldlM t.root (fun s k t => Lean.Meta.DiscrTree.Trie.foldM #[k] f s t) init
Instances For
Fold over the keys and values stored in a DiscrTree
Equations
- Lean.Meta.DiscrTree.fold f init t = Id.run (Lean.Meta.DiscrTree.foldM (fun s keys a => pure (f s keys a)) init t)
Instances For
Monadically fold over the values stored in a DiscrTree
.
Equations
- Lean.Meta.DiscrTree.foldValuesM f init t = Lean.PersistentHashMap.foldlM t.root (fun s x t => Lean.Meta.DiscrTree.Trie.foldValuesM f s t) init
Instances For
Fold over the values stored in a DiscrTree
.
Equations
- Lean.Meta.DiscrTree.foldValues f init t = Id.run (Lean.Meta.DiscrTree.foldValuesM f init t)
Instances For
Extract the values stored in a DiscrTree
.
Equations
- Lean.Meta.DiscrTree.values t = Lean.Meta.DiscrTree.foldValues (fun as a => Array.push as a) #[] t
Instances For
Extract the keys and values stored in a DiscrTree
.
Equations
- Lean.Meta.DiscrTree.toArray t = Lean.Meta.DiscrTree.fold (fun as keys a => Array.push as (keys, a)) #[] t
Instances For
Get the number of values stored in a DiscrTree
. O(n) in the size of the tree.
Equations
- Lean.Meta.DiscrTree.size t = Lean.PersistentHashMap.foldl t.root (fun n x t => n + Lean.Meta.DiscrTree.Trie.size t) 0
Instances For
Merge two DiscrTree
s. Duplicate values are preserved.
Equations
- One or more equations did not get rendered due to their size.