@@ -62,6 +62,7 @@ module Data.Map.Monoidal.Strict
6262 , fromAscListWith
6363 , fromAscListWithKey
6464 , fromDistinctAscList
65+ , fromDistinctList
6566 , fromList
6667 , fromListWith
6768 , fromListWithKey
@@ -476,8 +477,8 @@ toList :: forall k a. MonoidalMap k a -> [(k, a)]
476477toList = coerce (M.toList :: M.Map k a -> [(k, a)])
477478{-# INLINE toList #-}
478479
479−fromList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
480−fromList = coerce (M.fromList :: [(k, a)] -> M.Map k a)
480+fromList :: forall k a. (Ord k, Semigroup a) => [(k, a)] -> MonoidalMap k a
481+fromList = fromListWith (<>)
481482{-# INLINE fromList #-}
482483
483484fromListWith :: forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
@@ -496,8 +497,8 @@ toDescList :: forall k a. MonoidalMap k a -> [(k, a)]
496497toDescList = coerce (M.toDescList :: M.Map k a -> [(k, a)])
497498{-# INLINE toDescList #-}
498499
499−fromAscList :: forall k a. Eq k => [(k, a)] -> MonoidalMap k a
500−fromAscList = coerce (M.fromAscList :: [(k, a)] -> M.Map k a)
500+fromAscList :: forall k a. (Eq k, Semigroup a) => [(k, a)] -> MonoidalMap k a
501+fromAscList = fromAscListWith (<>)
501502{-# INLINE fromAscList #-}
502503
503504fromAscListWith :: forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
@@ -512,6 +513,10 @@ fromDistinctAscList :: forall k a. [(k, a)] -> MonoidalMap k a
512513fromDistinctAscList = coerce (M.fromDistinctAscList :: [(k, a)] -> M.Map k a)
513514{-# INLINE fromDistinctAscList #-}
514515
516+fromDistinctList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
517+fromDistinctList = coerce (M.fromList :: [(k, a)] -> M.Map k a)
518+{-# INLINE fromDistinctList #-}
519+
515520filter :: forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
516521filter = coerce (M.filter :: (a -> Bool) -> M.Map k a -> M.Map k a)
517522{-# INLINE filter #-}