@[instance_reducible]
Equations
Equations
- Lean.instBEqNamePart.beq (Lean.NamePart.str a) (Lean.NamePart.str b) = (a == b)
- Lean.instBEqNamePart.beq (Lean.NamePart.num a) (Lean.NamePart.num b) = (a == b)
- Lean.instBEqNamePart.beq x✝¹ x✝ = false
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
- Lean.instToStringNamePart = { toString := fun (x : Lean.NamePart) => match x with | Lean.NamePart.str s => s | Lean.NamePart.num n => toString n }
Equations
- (Lean.NamePart.str a).cmp (Lean.NamePart.str b) = compare a b
- (Lean.NamePart.num a).cmp (Lean.NamePart.num b) = compare a b
- (Lean.NamePart.num n).cmp (Lean.NamePart.str s) = Ordering.lt
- x✝¹.cmp x✝ = Ordering.gt
Instances For
Equations
- (Lean.NamePart.str a).lt (Lean.NamePart.str b) = decide (a < b)
- (Lean.NamePart.num a).lt (Lean.NamePart.num b) = decide (a < b)
- (Lean.NamePart.num n).lt (Lean.NamePart.str s) = true
- x✝¹.lt x✝ = false
Instances For
Equations
Instances For
Equations
- t.insert n b = Lean.PrefixTree.insert t (Lean.toKey✝ n) b
Instances For
Equations
Instances For
@[instance_reducible]
Equations
- Lean.instInhabitedNameTrie = { default := Lean.NameTrie.empty }
@[instance_reducible]
Equations
- Lean.instEmptyCollectionNameTrie = { emptyCollection := Lean.NameTrie.empty }
Equations
- t.find? k = Lean.PrefixTree.find? t (Lean.toKey✝ k)
Instances For
@[inline]
Returns the value of the longest key in t that is a prefix of k, if any.
Equations
Instances For
@[inline]
def Lean.NameTrie.foldMatchingM {m : Type u_1 → Type u_2} {β : Type u_3} {σ : Type u_1} [Monad m] (t : NameTrie β) (k : Name) (init : σ) (f : β → σ → m σ) :
m σ
Equations
- t.foldMatchingM k init f = Lean.PrefixTree.foldMatchingM t (Lean.toKey✝ k) init f
Instances For
@[inline]
def Lean.NameTrie.foldM {m : Type u_1 → Type u_2} {β : Type u_3} {σ : Type u_1} [Monad m] (t : NameTrie β) (init : σ) (f : β → σ → m σ) :
m σ
Equations
- t.foldM init f = t.foldMatchingM Lean.Name.anonymous init f
Instances For
@[inline]
def Lean.NameTrie.forMatchingM {m : Type → Type u_1} {β : Type u_2} [Monad m] (t : NameTrie β) (k : Name) (f : β → m Unit) :
m Unit
Equations
- t.forMatchingM k f = Lean.PrefixTree.forMatchingM t (Lean.toKey✝ k) f
Instances For
@[inline]
def Lean.NameTrie.forM {m : Type → Type u_1} {β : Type u_2} [Monad m] (t : NameTrie β) (f : β → m Unit) :
m Unit
Equations
- t.forM f = t.forMatchingM Lean.Name.anonymous f
Instances For
Equations
- t.matchingToArray k = (t.foldMatchingM k #[] fun (v : β) (acc : Array β) => pure (acc.push v)).run