
26 Jul
2011
26 Jul
'11
5:41 p.m.
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