Additional API for HashMap
and RBSet
. #
As HashMap
has been completely reimplemented in Batteries
,
nothing from the mathlib3 file data.hash_map
is reflected here.
The porting header is just here to mark that no further work on data.hash_map
is desired.
@[deprecated]
def
Batteries.HashMap.keys
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
(m : Batteries.HashMap α β)
:
List α
The list of keys in a HashMap
.
Equations
- m.keys = Batteries.HashMap.fold (fun (ks : List α) (k : α) (x : β) => k :: ks) [] m
Instances For
@[deprecated]
def
Batteries.HashMap.values
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
(m : Batteries.HashMap α β)
:
List β
The list of values in a HashMap
.
Equations
- m.values = Batteries.HashMap.fold (fun (vs : List β) (x : α) (v : β) => v :: vs) [] m
Instances For
@[deprecated]
def
Batteries.HashMap.consVal
{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
(self : Batteries.HashMap α (List β))
(a : α)
(b : β)
:
Batteries.HashMap α (List β)
Add a value to a HashMap α (List β)
viewed as a multimap.
Equations
Instances For
@[deprecated]
def
Batteries.RBSet.insertList
{α : Type u_1}
{cmp : α → α → Ordering}
(m : Batteries.RBSet α cmp)
(L : List α)
:
Batteries.RBSet α cmp
Insert all elements of a list into an RBSet
.
Equations
- m.insertList L = List.foldl (fun (m : Batteries.RBSet α cmp) (a : α) => m.insert a) m L