[Haskell-cafe] Re: Processing of large files

Alexander Kogan alexander at kogan.nnov.ru
Tue Nov 2 03:53:52 EST 2004


Hi!

Now I try to use FiniteMap to speed up the processing.

merge' :: FiniteMap String Integer -> String -> FiniteMap String Integer
merge' a x = addToFM_C (+) a x 1

parse' :: [String] -> [(String, Integer)]
parse' x = fmToList $ foldl' merge' emptyFM x

Where should I add `seq` to make FiniteMap strict?
I tried 
merge' a x = let r = addToFM_C (+) a x 1 in r `seq` r
but it doesn't help.

-- 
Alexander Kogan
Institute of Applied Physics
Russian Academy of Sciences


More information about the Haskell-Cafe mailing list