@[instance_reducible]
Equations
@[reducible, inline]
Equations
Instances For
@[instance_reducible]
instance Lean.AssocList.instEmptyCollection {α : Type u} {β : Type v} :
EmptyCollection (AssocList α β)
Equations
- Lean.AssocList.instEmptyCollection = { emptyCollection := Lean.AssocList.empty }
@[reducible, inline]
abbrev Lean.AssocList.insertNew {α : Type u} {β : Type v} (m : AssocList α β) (k : α) (v : β) :
AssocList α β
Equations
- m.insertNew k v = Lean.AssocList.cons k v m
Instances For
@[specialize #[]]
def Lean.AssocList.foldlM {α : Type u} {β : Type v} {δ : Type w} {m : Type w → Type w'} [Monad m] (f : δ → α → β → m δ) (init : δ) :
AssocList α β → m δ
Equations
- Lean.AssocList.foldlM f x✝ Lean.AssocList.nil = pure x✝
- Lean.AssocList.foldlM f x✝ (Lean.AssocList.cons a b es) = do let d ← f x✝ a b Lean.AssocList.foldlM f d es
Instances For
@[inline]
def Lean.AssocList.foldl {α : Type u} {β : Type v} {δ : Type w} (f : δ → α → β → δ) (init : δ) (as : AssocList α β) :
δ
Equations
- Lean.AssocList.foldl f init as = (Lean.AssocList.foldlM (fun (x1 : δ) (x2 : α) (x3 : β) => pure (f x1 x2 x3)) init as).run
Instances For
@[specialize #[]]
def Lean.AssocList.forM {α : Type u} {β : Type v} {m : Type w → Type w'} [Monad m] (f : α → β → m PUnit) :
Equations
- Lean.AssocList.forM f Lean.AssocList.nil = pure PUnit.unit
- Lean.AssocList.forM f (Lean.AssocList.cons a b es) = do f a b Lean.AssocList.forM f es
Instances For
Equations
- Lean.AssocList.mapKey f Lean.AssocList.nil = Lean.AssocList.nil
- Lean.AssocList.mapKey f (Lean.AssocList.cons a b es) = Lean.AssocList.cons (f a) b (Lean.AssocList.mapKey f es)
Instances For
Equations
- Lean.AssocList.mapVal f Lean.AssocList.nil = Lean.AssocList.nil
- Lean.AssocList.mapVal f (Lean.AssocList.cons a b es) = Lean.AssocList.cons a (f b) (Lean.AssocList.mapVal f es)
Instances For
Equations
- Lean.AssocList.findEntry? a Lean.AssocList.nil = none
- Lean.AssocList.findEntry? a (Lean.AssocList.cons a_1 b es) = match a_1 == a with | true => some (a_1, b) | false => Lean.AssocList.findEntry? a es
Instances For
Equations
- Lean.AssocList.find? a Lean.AssocList.nil = none
- Lean.AssocList.find? a (Lean.AssocList.cons a_1 b es) = match a_1 == a with | true => some b | false => Lean.AssocList.find? a es
Instances For
Equations
- Lean.AssocList.contains a Lean.AssocList.nil = false
- Lean.AssocList.contains a (Lean.AssocList.cons a_1 b es) = (a_1 == a || Lean.AssocList.contains a es)
Instances For
Equations
- Lean.AssocList.replace a b Lean.AssocList.nil = Lean.AssocList.nil
- Lean.AssocList.replace a b (Lean.AssocList.cons a_1 b_1 es) = match a_1 == a with | true => Lean.AssocList.cons a b es | false => Lean.AssocList.cons a_1 b_1 (Lean.AssocList.replace a b es)
Instances For
Equations
- Lean.AssocList.erase a Lean.AssocList.nil = Lean.AssocList.nil
- Lean.AssocList.erase a (Lean.AssocList.cons a_1 b es) = match a_1 == a with | true => es | false => Lean.AssocList.cons a_1 b (Lean.AssocList.erase a es)
Instances For
Equations
- Lean.AssocList.any p Lean.AssocList.nil = false
- Lean.AssocList.any p (Lean.AssocList.cons a b es) = (p a b || Lean.AssocList.any p es)
Instances For
Equations
- Lean.AssocList.all p Lean.AssocList.nil = true
- Lean.AssocList.all p (Lean.AssocList.cons a b es) = (p a b && Lean.AssocList.all p es)