Ticket #1460 (closed proposal: fixed)
Problem with Monoid instance of Data.Map
| Reported by: | ahey@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Not GHC |
| Component: | libraries/base | Version: | 6.6.1 |
| Keywords: | Data.Map Monoid | Cc: | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Easy (less than 1 hour) | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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
Change History
Note: See
TracTickets for help on using
tickets.
