Monadic version of functions for containers (adjustM, updateWithKeyM, etc)

Ian Lynagh igloo at earth.li
Tue Sep 28 09:57:35 EDT 2010


On Tue, Sep 28, 2010 at 08:35:30AM -0400, Jean-Philippe Bernardy wrote:
> On Tue, Sep 28, 2010 at 12:08 AM, Thomas DuBuisson
> <thomas.dubuisson at gmail.com> wrote:
> 
> > If the number of functions becomes a concern we can be effective and
> > still conservative.  Take Data.Map as an example, we can make
> > updateLookupWithKeyM and omit alterM,
> > [***]
> 
> alter is the most powerful function. It can perform an insertion,
> while updateLookupWithKey
> cannot.

I don't understand why the number of functions is such an issue. To me,
ease of use is more important.

For example, (assuming the performance is, or could be made, the same),
would Data.List be improved by removing concat and map, as they can be
written as (concatMap id) and (concatMap . (return .))?


Thanks
Ian



More information about the Libraries mailing list