
13 Mar
2008
13 Mar
'08
12:52 p.m.
Krzysztof Kościuszkiewicz wrote:
I have tried both Poly.StateLazy and Poly.State and they work quite well - at least the space leak is eliminated. Now evaluation of the parser state blows the stack...
The code is at http://hpaste.org/6310
Apparently, stUpdate is too lazy. I'd define stUpdate' :: (s -> s) -> Parser s t () stUpdate' f = stUpdate f >> stGet >>= (`seq` return ()) and try using stUpdate' instead of stUpdate in incCount. HTH, Bertram