
28 Dec
2005
28 Dec
'05
10:05 p.m.
David Roundy wrote:
stats elems = foldl add_elem Map.empty elems add_elem m x = Map.insertWith (+) x 1 m [...] I tried defining
add_elem m x = let m' = Map.insertWith (+) x 1 m Just num = Map.lookup x m' in seq num m' to force the (+) to be evaluated strictly, but that didn't help.
No, it doesn't, unless you also use foldl'. Not tested, but been there, seen it, bought the t-shirt. Udo. -- The Force is what holds everything together. It has its dark side, and it has its light side. It's sort of like cosmic duct tape.