#2580: export Data.Map.toDescList
-------------------------------+--------------------------------------------
Reporter: elaforge | Owner: igloo
Type: proposal | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 6.8.3
Severity: normal | Resolution:
Keywords: | Testcase:
Architecture: Unknown | Os: Unknown
-------------------------------+--------------------------------------------
Changes (by elaforge):
* owner: => igloo
Comment:
Replacing patch yet again to export foldrWithKey also.
Summary from the "thread" such as it was:
Benedikt suggested adding something like:
> viewAssocs :: Map k v -> MapView (k,v)
> instance Foldable MapView
This might be a good idea for the future but I wanted to keep the scope of
the patch under control.
On further thought, it seemed asymmetrical to export foldWithKey and
foldlWithKey, so I added foldrWithKey to the export list, keeping
foldWithKey to not break existing code. I added a note to the haddock for
foldWithKey encouraging the use of foldrWithKey.
So we export:
toDescList - new, but implementable with foldlWithKey
foldlWithKey - new
foldrWithKey - the same as foldWithKey, but explicitly the mirror of
foldlWithKey
There were no other comments. I'm specifically not certain about the
laziness of the folds (i.e. will they lead to stack problems like
List.foldl), but no one said there was a problem, so maybe it's fine. I'm
also not sure if there was some important reason behind the reason the
folds were exported, but no one said anything, so maybe it was just
arbitrary.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2580#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs