List-like type to avoid extra level of indirection
- nil: {α : Type u} → {β : Type v} → Lean.AssocList α β
- cons: {α : Type u} → {β : Type v} → α → β → Lean.AssocList α β → Lean.AssocList α β
Instances For
instance
Lean.instInhabitedAssocList
{a✝ : Type u_1}
{a✝¹ : Type u_2}
:
Inhabited (Lean.AssocList a✝ a✝¹)
Equations
- Lean.instInhabitedAssocList = { default := Lean.AssocList.nil }
Equations
- Lean.AssocList.instEmptyCollection = { emptyCollection := Lean.AssocList.empty }
@[reducible, inline]
abbrev
Lean.AssocList.insert
{α : Type u}
{β : Type v}
(m : Lean.AssocList α β)
(k : α)
(v : β)
:
Lean.AssocList α β
Equations
- m.insert k v = Lean.AssocList.cons k v m
Instances For
Instances For
@[specialize #[]]
def
Lean.AssocList.foldlM
{α : Type u}
{β : Type v}
{δ : Type w}
{m : Type w → Type w}
[Monad m]
(f : δ → α → β → m δ)
(init : δ)
:
Lean.AssocList α β → m δ
Instances For
@[inline]
def
Lean.AssocList.foldl
{α : Type u}
{β : Type v}
{δ : Type w}
(f : δ → α → β → δ)
(init : δ)
(as : Lean.AssocList α β)
:
δ
Equations
- Lean.AssocList.foldl f init as = (Lean.AssocList.foldlM f init as).run
Instances For
Instances For
@[specialize #[]]
def
Lean.AssocList.forM
{α : Type u}
{β : Type v}
{m : Type w → Type w}
[Monad m]
(f : α → β → m PUnit)
:
Lean.AssocList α β → m PUnit
Instances For
def
Lean.AssocList.mapKey
{α : Type u}
{β : Type v}
{δ : Type w}
(f : α → δ)
:
Lean.AssocList α β → Lean.AssocList δ β
Instances For
def
Lean.AssocList.mapVal
{α : Type u}
{β : Type v}
{δ : Type w}
(f : β → δ)
:
Lean.AssocList α β → Lean.AssocList α δ
Instances For
def
Lean.AssocList.findEntry?
{α : Type u}
{β : Type v}
[BEq α]
(a : α)
:
Lean.AssocList α β → Option (α × β)
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
def
Lean.AssocList.replace
{α : Type u}
{β : Type v}
[BEq α]
(a : α)
(b : β)
:
Lean.AssocList α β → Lean.AssocList α β
Instances For
def
Lean.AssocList.erase
{α : Type u}
{β : Type v}
[BEq α]
(a : α)
:
Lean.AssocList α β → Lean.AssocList α β
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
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)
Instances For
@[inline]
def
Lean.AssocList.forIn
{α : Type u}
{β : Type v}
{δ : Type w}
{m : Type w → Type w'}
[Monad m]
(as : Lean.AssocList α β)
(init : δ)
(f : α × β → δ → m (ForInStep δ))
:
m δ
Equations
- as.forIn init f = Lean.AssocList.forIn.loop f init as
Instances For
@[specialize #[]]
def
Lean.AssocList.forIn.loop
{α : Type u}
{β : Type v}
{δ : Type w}
{m : Type w → Type w'}
[Monad m]
(f : α × β → δ → m (ForInStep δ))
:
δ → Lean.AssocList α β → m δ
Equations
- One or more equations did not get rendered due to their size.
- Lean.AssocList.forIn.loop f x Lean.AssocList.nil = pure x