[Haskell-cafe] Parsec memory behavior

Greg Fitzgerald garious at gmail.com
Wed May 17 17:10:53 EDT 2006


> big memory leak ... two parsers in sequence

A related question, are these two equivalents?

foldl2 f g y z lst = (foldl f y lst, foldl g z lst)
foldl2' f g y z lst = foldl (\(i, j) x -> (f i x, g j x)) (y, z) lst

If no, is there some strictness that can be added to make them equivalent?  And
if so, could a compiler make this optimization as to avoid these sorts of
space leaks?

Thanks,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060517/77ac5fad/attachment.htm


More information about the Haskell-Cafe mailing list