Commit 6f2eca11 authored by Joachim Breitner's avatar Joachim Breitner
Browse files

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
parent e87135ce
......@@ -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,
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment