@@ -5,7 +5,10 @@
55{-# LANGUAGE DeriveTraversable #-}
66{-# LANGUAGE DeriveDataTypeable #-}
77
8−module Data.Map.Monoidal ( MonoidalMap ) where
8+module Data.Map.Monoidal
9+ ( MonoidalMap
10+ , singleton
11+ ) where
912
1013import Data.Monoid
1114import Data.Foldable (Foldable)
@@ -55,3 +58,6 @@ instance Ord k => IsList (MonoidalMap k a) where
5558 fromList = MM . M.fromList
5659 toList = M.toList . unpack
5760#endif
61+
62+singleton :: Ord k => k -> a -> MonoidalMap k a
63+singleton k a = MM $ M.singleton k a