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
> [EMAIL PROTECTED]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 

-- 
 Hal Daume III                                   | [EMAIL PROTECTED]
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to