Skip to content

Commit 3307712

Browse files
committed
Refactor 'Data.HashSet'
1 parent 912be40 commit 3307712

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Data/HashSet.hs

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ module Data.HashSet
6767
, toList
6868
, fromList
6969

70-
-- * HashMaps
70+
-- * HashMapWs
7171
, toMap
7272
, fromMap
7373
) where
7474

7575
import Control.DeepSeq (NFData(..))
7676
import Data.Data hiding (Typeable)
77-
import Data.HashMap.Base (HashMap, foldrWithKey, equalKeys)
77+
import Data.HashMap.Base (HashMapW, foldrWithKey, equalKeys)
7878
import Data.Hashable (Hashable(hashWithSalt))
7979
#if __GLASGOW_HASKELL__ >= 711
8080
import Data.Semigroup (Semigroup(..), Monoid(..))
@@ -103,7 +103,7 @@ import qualified Data.Hashable.Lifted as H
103103

104104
-- | A set of values. A set cannot contain duplicate values.
105105
newtype HashSet a = HashSet {
106-
asMap :: HashMap a ()
106+
asMap :: HashMapW a ()
107107
} deriving (Typeable)
108108

109109
#if __GLASGOW_HASKELL__ >= 708
@@ -202,12 +202,12 @@ singleton :: Hashable a => a -> HashSet a
202202
singleton a = HashSet (H.singleton a ())
203203
{-# INLINABLE singleton #-}
204204

205-
-- | /O(1)/ Convert to the equivalent 'HashMap'.
206-
toMap :: HashSet a -> HashMap a ()
205+
-- | /O(1)/ Convert to the equivalent 'HashMapW'.
206+
toMap :: HashSet a -> HashMapW a ()
207207
toMap = asMap
208208

209-
-- | /O(1)/ Convert from the equivalent 'HashMap'.
210-
fromMap :: HashMap a () -> HashSet a
209+
-- | /O(1)/ Convert from the equivalent 'HashMapW'.
210+
fromMap :: HashMapW a () -> HashSet a
211211
fromMap = HashSet
212212

213213
-- | /O(n+m)/ Construct a set containing all elements from both sets.

0 commit comments

Comments
 (0)