Minor containers API changes

Milan Straka fox at ucw.cz
Mon Nov 28 21:43:29 CET 2011


> > 5) `toDescList` exists in Map, but not in IntMap, Set or IntSet.
> >
> >   Solutions: (a) deprecate `Map.toDescList`
> >              (b) add `toDescList` to IntMap. In this case, we should
> >                  consider adding it also to Set and IntSet.
> >
> >   I have no strong opinion here. The `toDescList` can be trivially
> >   expressed as left fold. But it is currently a subject to list fusion.
> >   To vote for (a).
> I actually added toDescList so I do have an opinion.  I couldn't
> figure out any way it could be expressed as a left fold (or maybe that
> left fold function didn't exist back then).  Without this function
> there's no way to (efficiently) iterate over a map backwards, which is
> pretty essential for an ordered collection!

The left folds are pretty new in the library (the commit log states 13
Jul 2011), so it definitely was not possible at that time.


More information about the Libraries mailing list