On 11-07-26 03:57 PM, Roman Cheplyaka wrote:
The code

   main = print $ foldl (+) 0 [1..1000000]

when compiled (without optimizations) results in a stack overflow, which
is expected.

However, when run from ghci it succeeds. Why is it so?
(Tested with GHC 6.12.something and 7.0.4)

To enjoy unlimited stack in compiled code, add +RTS -K10

To enjoy limited stack in ghci, add +RTS -K8M

To know why, see my
http://www.mail-archive.com/haskell-cafe@haskell.org/msg88368.html

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to