File tree Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 14
14
* ` Data.Map.Strict.mergeWithKey ` now forces the result of the combining function
15
15
to WHNF. (Soumik Sarkar)
16
16
17
+ * Fix an issue where ` Data.Map.mergeWithKey ` , ` Data.Map.Strict.mergeWithKey ` ,
18
+ ` Data.IntMap.mergeWithKey ` , ` Data.IntMap.Strict.mergeWithKey ` could call the
19
+ provided ` only2 ` function with empty maps, contrary to documentation.
20
+ (Soumik Sarkar)
21
+
17
22
## Unreleased with ` @since ` annotation for 0.7.1:
18
23
19
24
### Additions
Original file line number Diff line number Diff line change @@ -1446,6 +1446,8 @@ mergeWithKey' bin' f g1 g2 = go
1446
1446
| otherwise = maybe_link k1 (g1 t1) k2 (g2 t2)
1447
1447
merge0 t1 _ Nil = g1 t1
1448
1448
1449
+ go Nil Nil = Nil
1450
+
1449
1451
go Nil t2 = g2 t2
1450
1452
1451
1453
maybe_link _ Nil _ t2 = t2
Original file line number Diff line number Diff line change @@ -2782,6 +2782,7 @@ mergeWithKey :: Ord k
2782
2782
-> Map k a -> Map k b -> Map k c
2783
2783
mergeWithKey f g1 g2 = go
2784
2784
where
2785
+ go Tip Tip = Tip
2785
2786
go Tip t2 = g2 t2
2786
2787
go t1 Tip = g1 t1
2787
2788
go (Bin _ kx x l1 r1) t2 =
Original file line number Diff line number Diff line change @@ -1240,6 +1240,7 @@ mergeWithKey :: Ord k
1240
1240
-> Map k a -> Map k b -> Map k c
1241
1241
mergeWithKey f g1 g2 = go
1242
1242
where
1243
+ go Tip Tip = Tip
1243
1244
go Tip t2 = g2 t2
1244
1245
go t1 Tip = g1 t1
1245
1246
go (Bin _ kx x l1 r1) t2 =
You can’t perform that action at this time.
0 commit comments