diff --git a/Data/HashMap/Internal.hs b/Data/HashMap/Internal.hs index 9af96dd1..cf60bb43 100644 --- a/Data/HashMap/Internal.hs +++ b/Data/HashMap/Internal.hs @@ -142,9 +142,7 @@ module Data.HashMap.Internal , adjust# ) where -#if !MIN_VERSION_base(4,11,0) -import Data.Semigroup (Semigroup((<>))) -#endif +import Data.Semigroup (Semigroup(..), stimesIdempotentMonoid) import Control.DeepSeq (NFData(rnf)) import Control.Monad.ST (ST, runST) import Data.Bits ((.&.), (.|.), complement, popCount, unsafeShiftL, unsafeShiftR) @@ -296,6 +294,8 @@ instance Bifoldable HashMap where instance (Eq k, Hashable k) => Semigroup (HashMap k v) where (<>) = union {-# INLINE (<>) #-} + stimes = stimesIdempotentMonoid + {-# INLINE stimes #-} -- | 'mempty' = 'empty' -- diff --git a/Data/HashMap/Internal/Strict.hs b/Data/HashMap/Internal/Strict.hs index 725452fc..ef74a30f 100644 --- a/Data/HashMap/Internal/Strict.hs +++ b/Data/HashMap/Internal/Strict.hs @@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns, CPP, PatternGuards, MagicHash, UnboxedTuples #-} -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE Trustworthy #-} {-# OPTIONS_HADDOCK not-home #-} diff --git a/Data/HashSet/Internal.hs b/Data/HashSet/Internal.hs index 1071fc7e..e5e483db 100644 --- a/Data/HashSet/Internal.hs +++ b/Data/HashSet/Internal.hs @@ -97,9 +97,7 @@ import Data.HashMap.Internal ( HashMap, foldMapWithKey, foldlWithKey, foldrWithKey , equalKeys, equalKeys1) import Data.Hashable (Hashable(hashWithSalt)) -#if !MIN_VERSION_base(4,11,0) -import Data.Semigroup (Semigroup(..)) -#endif +import Data.Semigroup (Semigroup(..), stimesIdempotentMonoid) import GHC.Exts (build) import qualified GHC.Exts as Exts import Prelude hiding (filter, foldr, foldl, map, null) @@ -200,6 +198,8 @@ instance Foldable.Foldable HashSet where instance (Hashable a, Eq a) => Semigroup (HashSet a) where (<>) = union {-# INLINE (<>) #-} + stimes = stimesIdempotentMonoid + {-# INLINE stimes #-} -- | 'mempty' = 'empty' --