Skip to content

Commit

Permalink
fix: botched merge
Browse files Browse the repository at this point in the history
  • Loading branch information
digama0 committed Oct 3, 2024
1 parent fc871f7 commit 63c1c38
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Batteries/Data/HashMap/WF.lean
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,13 @@ variable {_ : BEq α} {_ : Hashable α}
@[inline] def mapVal (f : α → β → γ) (self : HashMap α β) : HashMap α γ :=
⟨self.1.mapVal f, self.2.mapVal⟩

-- Temporarily removed on lean-pr-testing-5403.

-- /--
-- Applies `f` to each key-value pair `a, b` in the map. If it returns `some c` then
-- `a, c` is pushed into the new map; else the key is removed from the map.
-- -/
-- @[inline] def filterMap (f : α → β → Option γ) (self : HashMap α β) : HashMap α γ :=
-- ⟨self.1.filterMap f, self.2.filterMap⟩

-- /-- Constructs a map with the set of all pairs `a, b` such that `f` returns true. -/
-- @[inline] def filter (f : α → β → Bool) (self : HashMap α β) : HashMap α β :=
-- self.filterMap fun a b => bif f a b then some b else none
/--
Applies `f` to each key-value pair `a, b` in the map. If it returns `some c` then
`a, c` is pushed into the new map; else the key is removed from the map.
-/
@[inline] def filterMap (f : α → β → Option γ) (self : HashMap α β) : HashMap α γ :=
⟨self.1.filterMap f, self.2.filterMap⟩

/-- Constructs a map with the set of all pairs `a, b` such that `f` returns true. -/
@[inline] def filter (f : α → β → Bool) (self : HashMap α β) : HashMap α β :=
self.filterMap fun a b => bif f a b then some b else none

0 comments on commit 63c1c38

Please sign in to comment.