Data.Map.map should be deprecated/removed
(Note: Every claim here referring to Data.Map.map applies equally well to Data.IntMap.map.)
I believe that Data.Map.map is a misfeature and should be deprecated or removed.
- Its name clashes with an extremely commonly-used Prelude function. This makes the first import of Data.Map into an existing module very expensive. Either all existing instances of "map" need to be qualified, or the import of Data.Map needs to be qualified (which works, but makes (!) and (\\) unnecessarily inelegant), or the import must hide map.
- There is an easy way to get at the functionality which is already implemented: use fmap.
Data.Set.map and Data.IntSet.map have similar problems, however you can't just "use fmap" in that case. I don't have a good solution except to rename these.
Data.Map.null also clashes with the Prelude, and should be reconsidered. However, again, there isn't a simple workaround, and there are many more overloadings of null (e.g. Data.ByteString). It's also likely that null is used far less than map, so the cost of a clash is much lower.
Trac metadata
Trac field | Value |
---|---|
Version | 6.6 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Multiple |
Architecture | Multiple |