File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
containers-tests/benchmarks Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ main = do
2727 , bench " lookup present" $ whnf (lookup evens) m_even
2828 , bench " map" $ whnf (M. map (+ 1 )) m
2929 , bench " map really" $ nf (M. map (+ 2 )) m
30+ , bench " filter" $ whnf (M. filter even ) m
31+ , bench " filter really" $ nf (M. filter even ) m
3032 , bench " <$" $ whnf ((1 :: Int ) <$ ) m
3133 , bench " <$ really" $ nf ((2 :: Int ) <$ ) m
3234 , bench " alterF lookup absent" $ whnf (atLookup evens) m_odd
Original file line number Diff line number Diff line change @@ -2966,6 +2966,9 @@ filter p m
29662966
29672967filterWithKey :: (k -> a -> Bool ) -> Map k a -> Map k a
29682968filterWithKey _ Tip = Tip
2969+ filterWithKey p t@ (Bin 1 kx x _ _)
2970+ | p kx x = t
2971+ | otherwise = Tip
29692972filterWithKey p t@ (Bin _ kx x l r)
29702973 | p kx x = if pl `ptrEq` l && pr `ptrEq` r
29712974 then t
You can’t perform that action at this time.
0 commit comments