@@ -98,11 +98,11 @@ instance (Eq k, Hashable k, Semigroup a) => Semigroup (MonoidalHashMap k a) wher
9898 MonoidalHashMap a <> MonoidalHashMap b = MonoidalHashMap $ M.unionWith (<>) a b
9999 {-# INLINE (<>) #-}
100100
101−instance (Eq k, Hashable k, Monoid a) => Monoid (MonoidalHashMap k a) where
101+instance (Eq k, Hashable k, Semigroup a) => Monoid (MonoidalHashMap k a) where
102102 mempty = MonoidalHashMap mempty
103103 {-# INLINE mempty #-}
104104#if !(MIN_VERSION_base(4,11,0))
105− mappend (MonoidalHashMap a) (MonoidalHashMap b) = MonoidalHashMap $ M.unionWith mappend a b
105+ mappend (MonoidalHashMap a) (MonoidalHashMap b) = MonoidalHashMap $ M.unionWith (<>) a b
106106 {-# INLINE mappend #-}
107107#endif
108108
@@ -113,9 +113,9 @@ instance Newtype (MonoidalHashMap k a) (M.HashMap k a) where
113113 {-# INLINE unpack #-}
114114
115115#if MIN_VERSION_base(4,7,0)
116−instance (Eq k, Hashable k, Monoid a) => Exts.IsList (MonoidalHashMap k a) where
116+instance (Eq k, Hashable k, Semigroup a) => Exts.IsList (MonoidalHashMap k a) where
117117 type Item (MonoidalHashMap k a) = (k, a)
118− fromList = MonoidalHashMap . M.fromListWith mappend
118+ fromList = MonoidalHashMap . M.fromListWith (<>)
119119 {-# INLINE fromList #-}
120120 toList = M.toList . unpack
121121 {-# INLINE toList #-}
@@ -173,8 +173,8 @@ keys = M.keys . unpack
173173
174174-- | /O(n*log n)/. Construct a map with the supplied mappings. If the list
175175-- contains duplicate mappings, values will be merged using (mappend newVal oldVal).
176−fromList :: (Eq k, Hashable k, Monoid a) => [(k,a)] -> MonoidalHashMap k a
177−fromList = pack . M.fromListWith mappend
176+fromList :: (Eq k, Hashable k, Semigroup a) => [(k,a)] -> MonoidalHashMap k a
177+fromList = pack . M.fromListWith (<>)
178178{-# INLINE fromList #-}
179179
180180-- | /O(n*log n)/. Return a list of this map's elements. The list is produced
@@ -218,7 +218,7 @@ modify f k = pack
218218
219219-- | /O(log n)/. Modify a value on some key with a function, providing
220220-- a default value if that key doesn't exist.
221−modifyDef :: (Monoid a, Hashable k, Eq k)
221+modifyDef :: (Semigroup a, Hashable k, Eq k)
222222 => a -> (a -> a)
223223 -> k -> MonoidalHashMap k a
224224 -> MonoidalHashMap k a
@@ -229,7 +229,7 @@ modifyDef d f k = pack
229229
230230-- | /O(n)/. Map a function to each key of a map, if it will result
231231-- in duplicated mappings, their values will be merged in unspecified order
232−mapKeys :: (Monoid a, Hashable k, Eq k, Hashable k', Eq k')
232+mapKeys :: (Semigroup a, Hashable k, Eq k, Hashable k', Eq k')
233233 => (k -> k') -> MonoidalHashMap k a -> MonoidalHashMap k' a
234234mapKeys f = fromList
235235 . fmap (\(k, v) -> (f k, v))