@@ -62,6 +62,7 @@ module Data.Map.Monoidal.Strict
6262 , fromAscListWith
6363 , fromAscListWithKey
6464 , fromDistinctAscList
65+ , fromDistinctList
6566 , fromList
6667 , fromListWith
6768 , fromListWithKey
@@ -477,8 +478,8 @@ toList :: forall k a. MonoidalMap k a -> [(k, a)]
477478toList = coerce (M.toList :: M.Map k a -> [(k, a)])
478479{-# INLINE toList #-}
479480
480−fromList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
481−fromList = coerce (M.fromList :: [(k, a)] -> M.Map k a)
481+fromList :: forall k a. (Ord k, Semigroup a) => [(k, a)] -> MonoidalMap k a
482+fromList = fromListWith (<>)
482483{-# INLINE fromList #-}
483484
484485fromListWith :: forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
@@ -497,8 +498,8 @@ toDescList :: forall k a. MonoidalMap k a -> [(k, a)]
497498toDescList = coerce (M.toDescList :: M.Map k a -> [(k, a)])
498499{-# INLINE toDescList #-}
499500
500−fromAscList :: forall k a. Eq k => [(k, a)] -> MonoidalMap k a
501−fromAscList = coerce (M.fromAscList :: [(k, a)] -> M.Map k a)
501+fromAscList :: forall k a. (Eq k, Semigroup a) => [(k, a)] -> MonoidalMap k a
502+fromAscList = fromAscListWith (<>)
502503{-# INLINE fromAscList #-}
503504
504505fromAscListWith :: forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
@@ -513,6 +514,10 @@ fromDistinctAscList :: forall k a. [(k, a)] -> MonoidalMap k a
513514fromDistinctAscList = coerce (M.fromDistinctAscList :: [(k, a)] -> M.Map k a)
514515{-# INLINE fromDistinctAscList #-}
515516
517+fromDistinctList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
518+fromDistinctList = coerce (M.fromList :: [(k, a)] -> M.Map k a)
519+{-# INLINE fromDistinctList #-}
520+
516521filter :: forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
517522filter = coerce (M.filter :: (a -> Bool) -> M.Map k a -> M.Map k a)
518523{-# INLINE filter #-}