export toDescList from Data.Map

Evan Laforge qdunkan at gmail.com
Mon Sep 22 17:47:35 EDT 2008


>> So it's been a little while and there hasn't been any objection.
>> What's the next step?
>
> Please see:
> http://www.haskell.org/haskellwiki/Library_submissions#At_the_end_of_the_discussion_period
> (and if the concensus was to apply the patch, then you can assign the
> ticket to igloo).

Ok.  I'm not sure what the consensus was since no one said "looks
good", but I'm going to assume it was to apply, since no one said
"looks bad" either.  I'll add Benedikt's comments to the ticket in
case someone later wants to implement his suggestion (viewAssocs).

Here's what I added to the ticket when assigning to igloo:

So 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.

---

As another aside, it seems like it would be nice to fix up Map, Set,
IntMap, and IntSet, to hopefully give them a consistent API and maybe
reduce some of the rampant copy and paste reuse going on in there.
Maybe this GSoC thing for tries is doing that...


More information about the Libraries mailing list