[Haskell-cafe] Re: Processing of large files

Ketil Malde ketil+haskell at ii.uib.no
Tue Nov 2 03:55:05 EST 2004


Alexander Kogan <alexander at kogan.nnov.ru> writes:

> Thanks! I did the following:

For extra credit, you can use a FiniteMap to store the words and
counts.  They have, as you probably know, log n access times, and
should give you a substantial performance boost. :-)

(I have a feeling FMs are slow when the keys are Strings - is it
possible that a trie or other structure would be faster?  Or using
hashed keys, perhaps?)

> But I wonder why the very useful function foldl' as I define it is not 
> included into Prelude?

Me too - it's the main drawback going from Hugs to GHCi :-)

I also wonder if there's any important uses for foldl where foldr or
foldl' wouldn't be at least as good, but I'm sure somebody can come up
with an example.

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list