On 2008 Oct 19, at 11:18, Friedrich wrote:
"Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]> writes:
On 2008 Oct 19, at 2:07, Friedrich wrote:
Howerver even if Strings are bad I can not see why they are hanging
around so long. I open a file a read it line by line and I close the
file so all read string are "garbage" and getting rid of them should
not be that hard or should it?
If your code is too lazy, you have the whole file + the close
operation hanging around in unevaluated thunks until you print the
result and it all gets processed all at once. Laziness is a double-
edged sword.
Where in my code is this laziness hidden? Is it while recurions with
sum and count?
That would be my guess, although I'd have to examine the Core
(intermediate compilation stage) to be certain. Others here are
better at looking at Haskell code and seeing where the laziness
"leaks" are.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university KF8NH
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell