#1460: Problem with Monoid instance of Data.Map
-----------------------------+----------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner:
Type: proposal | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 6.6.1
Severity: normal | Keywords: Data.Map Monoid
Difficulty: Easy (1 hr) | Os: Multiple
Testcase: | Architecture: Multiple
-----------------------------+----------------------------------------------
See..
[http://www.haskell.org/pipermail/libraries/2007-May/007491.html]
Data.Map Monoid instance is currently..
{{{
instance (Ord k) => Monoid (Map k v) where
mempty = empty
mappend = union
mconcat = unions
}}}
..but probably should be..
{{{
instance (Ord k, Monoid v) => Monoid (Map k v) where
mempty = empty
mappend map0 map1 = unionWith mappend map0 map1
mconcat maps = foldr (unionWith mappend) empty maps
}}}
Adrian Hey
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1460>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs