∀ {α : Type u} {β : α → Type v} [inst : BEq α] [inst_1 : LawfulBEq α] (k : α) (f : Option (β k) → Option (β k))
  (l : List ((a : α) × β a)),
  Std.Internal.List.alterKey k f l =
    match f (Std.Internal.List.getValueCast? k l) with
    | none => Std.Internal.List.eraseKey k l
    | some v => Std.Internal.List.insertEntry k v l