[commit: ghc] master: Use Data.Map.mergeWithKey (6f2eca1)
git at git.haskell.org
git at git.haskell.org
Tue Oct 7 22:01:23 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6f2eca11b064c8e888badb8942a8fa4ba0fa7524/ghc
>---------------------------------------------------------------
commit 6f2eca11b064c8e888badb8942a8fa4ba0fa7524
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Tue Oct 7 17:07:36 2014 +0200
Use Data.Map.mergeWithKey
Summary: now that we can rely on having containers > 0.5.
Reviewers: austin
Subscribers: thomie, carter, ezyang, simonmar
Differential Revision: https://phabricator.haskell.org/D321
>---------------------------------------------------------------
6f2eca11b064c8e888badb8942a8fa4ba0fa7524
compiler/ghc.cabal.in | 2 +-
compiler/utils/UniqFM.lhs | 7 -------
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index fc3517a..0932749 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -49,7 +49,7 @@ Library
process >= 1 && < 1.3,
bytestring >= 0.9 && < 0.11,
time < 1.6,
- containers >= 0.1 && < 0.6,
+ containers >= 0.5 && < 0.6,
array >= 0.1 && < 0.6,
filepath >= 1 && < 1.4,
hpc,
diff --git a/compiler/utils/UniqFM.lhs b/compiler/utils/UniqFM.lhs
index c941ce8..3ea97e4 100644
--- a/compiler/utils/UniqFM.lhs
+++ b/compiler/utils/UniqFM.lhs
@@ -265,18 +265,11 @@ plusUFM (UFM x) (UFM y) = UFM (M.union y x)
plusUFM_C f (UFM x) (UFM y) = UFM (M.unionWith f x y)
plusUFM_CD f (UFM xm) dx (UFM ym) dy
-{-
-The following implementation should be used as soon as we can expect
-containers-0.5; presumably from GHC 7.9 on:
= UFM $ M.mergeWithKey
(\_ x y -> Just (x `f` y))
(M.map (\x -> x `f` dy))
(M.map (\y -> dx `f` y))
xm ym
--}
- = UFM $ M.intersectionWith f xm ym
- `M.union` M.map (\x -> x `f` dy) xm
- `M.union` M.map (\y -> dx `f` y) ym
minusUFM (UFM x) (UFM y) = UFM (M.difference x y)
intersectUFM (UFM x) (UFM y) = UFM (M.intersection x y)
intersectUFM_C f (UFM x) (UFM y) = UFM (M.intersectionWith f x y)
More information about the ghc-commits
mailing list