Nguyen Phan Dung writes:
 :
 | mylist :: [Integer]
 | mylist = [1..1000000000]
 | 
 | In Hugs, I type mylist to print out all the elements inside. However,
 | after printing about 22000 elements, the system crashs & outputs:
 | "Garbage collection fails to reclaim sufficient memory"

The declaration of mylist is a pattern binding, not a function binding
- see section 4.4.3 of the Haskell 98 report.

What that means in this particular case is that the system saves the
result in case you want to use it again, rather than freeing the part
of the list it's already printed.

Try typing [1..1000000000] at the Hugs prompt instead.

Regards,
Tom
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to