Proposal #3999: Improved folds for Data.Map and Data.IntMap

Roman Leshchinskiy rl at cse.unsw.edu.au
Thu Apr 22 21:11:55 EDT 2010


On 23/04/2010, at 04:36, Gwern Branwen wrote:

> On Thu, Apr 22, 2010 at 12:15 PM, Roman Leshchinskiy <rl at cse.unsw.edu.au> wrote:
>> 
>> Hmm, I'd love to see some real-world uses of foldl. I have no idea what to optimise it for in vector. Unfortunately, the link above doesn't give any examples.
>> 
>> Roman
> 
> Well, since you ask...
> 
> $ find . -name "*.hs" -exec grep -H ' foldl ' {} \;  > ~/fold.txt
> $ wc ~/fold.txt
>  2206  24333 225619 fold.txt

That doesn't really help me, though, because I can't tell why using foldl as opposed to foldl' is essential (or even correct) in these cases. In fact, at a cursory glance a lot of them look quite leaky to me.

Roman




More information about the Libraries mailing list