haskell-issues
haskell-issues copied to clipboard
containers: Modernize Data.Map
fromListWith
should be generalized to Foldable
, and we need fromListMap
functions (Foldable t, Monoid m) => (a -> m) -> t (k, a) -> Map k m
and perhaps (Foldable t, Monoid m) => (k -> m) -> t k -> Map k m
. Admittedly the last one is probably just to implement histogram :: Foldable t => t k -> Map k Int
, but in the end even putting histogram
itself into Data.Map
would be ok in my book.