Skip to content

Commit d117f3e

Browse files
committed
More review suggestions
1 parent 4a15a7a commit d117f3e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

containers-tests/benchmarks/Map.hs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,9 @@ main = do
9898
, bench "fromDistinctDescList" $ whnf M.fromDistinctDescList elems_rev
9999
, bench "fromDistinctDescList:fusion" $ whnf (\n -> M.fromDistinctDescList [(i,i) | i <- [n,n-1..1]]) bound
100100
, bench "minView" $ whnf (\m' -> case M.minViewWithKey m' of {Nothing -> 0; Just ((k,v),m'') -> k+v+M.size m''}) (M.fromAscList $ zip [1..10::Int] [100..110::Int])
101-
102-
, bench "restrictKeys+withoutKeys"
103-
$ whnf (\ks -> M.restrictKeys m ks :*: M.withoutKeys m ks) m_odd_keys
104-
, bcompare "/restrictKeys+withoutKeys/"
105-
$ bench "partitionKeys"
106-
$ whnf (M.partitionKeys m) m_odd_keys
101+
, bench "restrictKeys" $ whnf (M.restrictKeys m) m_odd_keys
102+
, bench "withoutKeys" $ whnf (M.withoutKeys m) m_odd_keys
103+
, bench "partitionKeys" $ whnf (M.partitionKeys m) m_odd_keys
107104
]
108105
where
109106
bound = 2^12

containers/src/Data/Map/Internal.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{-# LANGUAGE StandaloneDeriving #-}
88
{-# LANGUAGE Trustworthy #-}
99
{-# LANGUAGE TypeFamilies #-}
10-
{-# LANGUAGE ScopedTypeVariables #-}
1110
#endif
1211
#define USE_MAGIC_PROXY 1
1312

@@ -1954,7 +1953,7 @@ withoutKeys m (Set.Bin _ k ls rs) = case splitMember k m of
19541953
-- @
19551954
-- m \`partitionKeys\` s = (m ``restrictKeys`` s, m ``withoutKeys`` s)
19561955
-- @
1957-
partitionKeys :: forall k a. Ord k => Map k a -> Set k -> (Map k a, Map k a)
1956+
partitionKeys :: Ord k => Map k a -> Set k -> (Map k a, Map k a)
19581957
partitionKeys xs ys =
19591958
case partitionKeysWorker xs ys of
19601959
xs' :*: ys' -> (xs', ys')

0 commit comments

Comments
 (0)