Skip to content

Commit 0741c8a

Browse files
committed
Remove flexible instances, remove primed singleton function
1 parent 3e00ddb commit 0741c8a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Data/HashMap/Internal.hs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
{-# LANGUAGE RoleAnnotations #-}
55
{-# LANGUAGE TypeFamilies #-}
66
{-# LANGUAGE UnboxedTuples #-}
7-
{-# LANGUAGE FlexibleInstances #-}
87
{-# LANGUAGE LambdaCase #-}
98
#if __GLASGOW_HASKELL__ >= 802
109
{-# LANGUAGE TypeInType #-}
@@ -292,7 +291,7 @@ instance Foldable.Foldable (HashMapT salt k) where
292291

293292
#if MIN_VERSION_base(4,10,0)
294293
-- | @since 0.2.11
295-
instance Bifoldable HashMap where
294+
instance Bifoldable (HashMapT salt) where
296295
bifoldMap f g = foldMapWithKey (\ k v -> f k `mappend` g v)
297296
{-# INLINE bifoldMap #-}
298297
bifoldr f g = foldrWithKey (\ k v acc -> k `f` (v `g` acc))
@@ -390,7 +389,7 @@ instance Traversable (HashMapT salt k) where
390389
{-# INLINABLE traverse #-}
391390

392391
#if MIN_VERSION_base(4,9,0)
393-
instance Eq2 HashMap where
392+
instance Eq2 (HashMapT salt) where
394393
liftEq2 = equal2
395394

396395
instance Eq k => Eq1 (HashMapT salt k) where
@@ -461,7 +460,7 @@ equal2 eqk eqv t1 t2 = go (toList' t1 []) (toList' t2 [])
461460
leafEq (L k v) (L k' v') = eqk k k' && eqv v v'
462461

463462
#if MIN_VERSION_base(4,9,0)
464-
instance Ord2 HashMap where
463+
instance Ord2 (HashMapT salt) where
465464
liftCompare2 = cmp
466465

467466
instance Ord k => Ord1 (HashMapT salt k) where
@@ -602,11 +601,8 @@ empty :: forall k v salt . HashMapT salt k v
602601
empty = Empty
603602

604603
-- | /O(1)/ Construct a map with a single element.
605-
singleton :: (Hashable k, KnownNat salt) => k -> v -> HashMapT salt k v
606-
singleton = singleton'
607-
608-
singleton' :: forall k v salt . (Hashable k, KnownNat salt) => k -> v -> HashMapT salt k v
609-
singleton' k v = Leaf (hash (Proxy :: Proxy salt) k) (L k v)
604+
singleton :: forall k v salt . (Hashable k, KnownNat salt) => k -> v -> HashMapT salt k v
605+
singleton k v = Leaf (hash (Proxy :: Proxy salt) k) (L k v)
610606

611607
------------------------------------------------------------------------
612608
-- * Basic interface

0 commit comments

Comments
 (0)