Lemmas about association lists #
Each operation on AssocList is specified by a lemma relating it to the corresponding
operation on List (α × β), transported along AssocList.toList.
@[simp]
theorem Batteries.AssocList.filterMapVal_nil {α✝ : Type u_1} {β✝ : Type u_2} {α✝¹ : Type u_3} {f : α✝ → β✝ → Option α✝¹} :
theorem Batteries.AssocList.filterMapVal_cons {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : α → β → Option γ) (k : α) (v : β) (t : AssocList α β) :
filterMapVal f (cons k v t) = match f k v with
| none => filterMapVal f t
| some d => cons k d (filterMapVal f t)
@[simp]
theorem Batteries.AssocList.toList_filterMapVal {α : Type u_1} {β : Type u_2} {δ : Type u_3} (f : α → β → Option δ) (l : AssocList α β) :
(filterMapVal f l).toList = List.filterMap
(fun (x : α × β) =>
match x with
| (a, b) => Option.map (fun (v : δ) => (a, v)) (f a b))
l.toList
@[simp]
theorem Batteries.AssocList.findEntryP?_eq {α : Type u_1} {β : Type u_2} (p : α → β → Bool) (l : AssocList α β) :
@[simp]
theorem Batteries.AssocList.findEntry?_eq {α : Type u_1} {β : Type u_2} [BEq α] (a : α) (l : AssocList α β) :
theorem Batteries.AssocList.find?_eq_findEntry? {α : Type u_1} {β : Type u_2} [BEq α] (a : α) (l : AssocList α β) :
@[simp]
@[simp]
@[simp]