Yet another weakly defined bug report

Simon Marlow
Mon, 17 Feb 2003 13:41:12 -0000

> You should do the counting strictly:
>         Just n -> case n+1 of n1 -> addToFM f w n1

Careful - that case expression doesn't actually force n to be evaluated.
It's exactly equivalent to
   let n1 =3D n+1 in addToFM f w n1

You need to use seq to force evaluation.