[GHC] #1460: Problem with Monoid instance of Data.Map
GHC
trac at galois.com
Mon Jun 25 13:56:11 EDT 2007
#1460: Problem with Monoid instance of Data.Map
-----------------------------+----------------------------------------------
Reporter: ahey at iee.org | 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
-------------- next part --------------
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list