> You should do the counting strictly: >=20 > 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 =09 let n1 =3D n+1 in addToFM f w n1 You need to use seq to force evaluation. Cheers, Simon