git.iko.soy/monoidal-containers
on master help sign in
Map: Fix fromList implementation
commitc635fb28ffcb000192276d1d12850d251b90219f authorBen Gamari <ben@smart-cactus.org> dateMon 16 Mar 2015, 14:17 (12 years ago) parenteab7767
1 file changed+2−2
src/Data/Map/Monoidal.hs+2−2
src/Data/Map/Monoidal.hs+2−2
@@ -101,9 +101,9 @@ instance Newtype (MonoidalMap k a) (M.Map k a) where
101101 {-# INLINE unpack #-}
102102
103103#if MIN_VERSION_base(4,7,0)
104−instance Ord k => IsList (MonoidalMap k a) where
104+instance (Ord k, Monoid a) => IsList (MonoidalMap k a) where
105105 type Item (MonoidalMap k a) = (k, a)
106− fromList = MM . M.fromList
106+ fromList = MM . M.fromListWith mappend
107107 {-# INLINE fromList #-}
108108 toList = M.toList . unpack
109109 {-# INLINE toList #-}