Skip to content

Commit 9f7c5bd

Browse files
committed
More review suggestions
1 parent b6d6533 commit 9f7c5bd

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

containers-tests/benchmarks/Map.hs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Main where
55
import Control.Applicative (Const(Const, getConst), pure)
66
import Control.DeepSeq (rnf)
77
import Control.Exception (evaluate)
8-
import Test.Tasty.Bench (bench, defaultMain, whnf, nf, bcompare)
8+
import Test.Tasty.Bench (bench, defaultMain, whnf, nf)
99
import Data.Functor.Identity (Identity(..))
1010
import Data.List (foldl')
1111
import qualified Data.Map as M
@@ -15,7 +15,6 @@ import Data.Maybe (fromMaybe)
1515
import Data.Functor ((<$))
1616
import Data.Coerce
1717
import Prelude hiding (lookup)
18-
import Utils.Containers.Internal.StrictPair
1918

2019
main = do
2120
let m = M.fromAscList elems :: M.Map Int Int
@@ -102,11 +101,9 @@ main = do
102101
, bench "eq" $ whnf (\m' -> m' == m') m -- worst case, compares everything
103102
, bench "compare" $ whnf (\m' -> compare m' m') m -- worst case, compares everything
104103

105-
, bench "restrictKeys+withoutKeys"
106-
$ whnf (\ks -> M.restrictKeys m ks :*: M.withoutKeys m ks) m_odd_keys
107-
, bcompare "/restrictKeys+withoutKeys/"
108-
$ bench "partitionKeys"
109-
$ whnf (M.partitionKeys m) m_odd_keys
104+
, bench "restrictKeys" $ whnf (M.restrictKeys m) m_odd_keys
105+
, bench "withoutKeys" $ whnf (M.withoutKeys m) m_odd_keys
106+
, bench "partitionKeys" $ whnf (M.partitionKeys m) m_odd_keys
110107
]
111108
where
112109
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
#define USE_MAGIC_PROXY 1
1211
#endif
1312

@@ -1977,7 +1976,7 @@ withoutKeys m (Set.Bin _ k ls rs) = case splitMember k m of
19771976
-- @
19781977
-- m \`partitionKeys\` s = (m ``restrictKeys`` s, m ``withoutKeys`` s)
19791978
-- @
1980-
partitionKeys :: forall k a. Ord k => Map k a -> Set k -> (Map k a, Map k a)
1979+
partitionKeys :: Ord k => Map k a -> Set k -> (Map k a, Map k a)
19811980
partitionKeys xs ys =
19821981
case partitionKeysWorker xs ys of
19831982
xs' :*: ys' -> (xs', ys')

0 commit comments

Comments
 (0)