[Haskell-cafe] Re: Processing of large files
Hal Daume III
hdaume at ISI.EDU
Wed Nov 3 15:08:35 EST 2004
you can steal my version of finitemap:
http://www.isi.edu/~hdaume/haskell/FiniteMap.hs
which is based on the GHC version, but supports strict operations.
the strict version of function f is called f'. i've also added some ops i
thought were missing.
On Wed, 3 Nov 2004, Scott Turner wrote:
> On 2004 November 03 Wednesday 09:51, Alexander Kogan wrote:
> > merge' a x = (addToFM (+) $! a) x 1
> > is not strict.
> > Can I do something to make FiniteMap strict?
> > Or the only way is to make my own StrictFiniteMap?
>
> You can replace
> addToFM_C (+) a x 1
> with
> let a' = addToFM_C (+) a x 1 in
> lookupFM a' x `seq` a'
> or you can generalize that into your own strict version of addToFM_C. It's a
> little ugly, but probably gets the job done.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
--
Hal Daume III | hdaume at isi.edu
"Arrest this man, he talks in maths." | www.isi.edu/~hdaume
More information about the Haskell-Cafe
mailing list