[Haskell-cafe] Re: Processing of large files

Tomasz Zielonka t.zielonka at students.mimuw.edu.pl
Thu Nov 4 02:03:56 EST 2004


On Thu, Nov 04, 2004 at 09:48:47AM +0300, Alexander Kogan wrote:
> Hi!
> 
> > You can replace
> >     addToFM_C (+) a x 1
> > with
> >     let a' = addToFM_C (+) a x 1 in
> >         lookupFM a' x `seq` a'
> 
> it is not strict also.

How about this?

  let a' = addToFM_C (+) a x 1 in
      maybe () (`seq` ()) (lookupFM a' x) `seq` a'

It worked for me.

Best regards,
Tom

-- 
.signature: Too many levels of symbolic links


More information about the Haskell-Cafe mailing list