From d117f3e9c3a9f506dcf8e12501fd3ffd25dad0f3 Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Sat, 6 Apr 2024 11:21:05 +0100 Subject: [PATCH] More review suggestions --- containers-tests/benchmarks/Map.hs | 9 +++------ containers/src/Data/Map/Internal.hs | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/containers-tests/benchmarks/Map.hs b/containers-tests/benchmarks/Map.hs index 94691a055..5524e0358 100644 --- a/containers-tests/benchmarks/Map.hs +++ b/containers-tests/benchmarks/Map.hs @@ -98,12 +98,9 @@ main = do , bench "fromDistinctDescList" $ whnf M.fromDistinctDescList elems_rev , bench "fromDistinctDescList:fusion" $ whnf (\n -> M.fromDistinctDescList [(i,i) | i <- [n,n-1..1]]) bound , 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]) - - , bench "restrictKeys+withoutKeys" - $ whnf (\ks -> M.restrictKeys m ks :*: M.withoutKeys m ks) m_odd_keys - , bcompare "/restrictKeys+withoutKeys/" - $ bench "partitionKeys" - $ whnf (M.partitionKeys m) m_odd_keys + , bench "restrictKeys" $ whnf (M.restrictKeys m) m_odd_keys + , bench "withoutKeys" $ whnf (M.withoutKeys m) m_odd_keys + , bench "partitionKeys" $ whnf (M.partitionKeys m) m_odd_keys ] where bound = 2^12 diff --git a/containers/src/Data/Map/Internal.hs b/containers/src/Data/Map/Internal.hs index a6d4c3214..05d481b3e 100644 --- a/containers/src/Data/Map/Internal.hs +++ b/containers/src/Data/Map/Internal.hs @@ -7,7 +7,6 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE ScopedTypeVariables #-} #endif #define USE_MAGIC_PROXY 1 @@ -1954,7 +1953,7 @@ withoutKeys m (Set.Bin _ k ls rs) = case splitMember k m of -- @ -- m \`partitionKeys\` s = (m ``restrictKeys`` s, m ``withoutKeys`` s) -- @ -partitionKeys :: forall k a. Ord k => Map k a -> Set k -> (Map k a, Map k a) +partitionKeys :: Ord k => Map k a -> Set k -> (Map k a, Map k a) partitionKeys xs ys = case partitionKeysWorker xs ys of xs' :*: ys' -> (xs', ys')