[Haskell-cafe] Space leak - help needed

Krzysztof Kościuszkiewicz k.kosciuszkiewicz at gmail.com
Thu Mar 13 18:38:06 EDT 2008


On Thu, Mar 13, 2008 at 05:52:05PM +0100, Bertram Felgenhauer wrote:

> > ... 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.

Yes, that solves the stack issue. Thanks!
-- 
Krzysztof Kościuszkiewicz
Skype: dr.vee,  Gadu: 111851,  Jabber: kokr at jabberpl.org
"Simplicity is the ultimate sophistication" -- Leonardo da Vinci


More information about the Haskell-Cafe mailing list