The GHCi stack is bigger than you think. IIRC, the default stack size for the compiled program is 500M for GHCi, while the default stack size for the compiled program is currently 8M. You can set a smaller limit yourself to see that you get a stack overflow (or you can significantly increase your argument).
$ ghci +RTS -K1M GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> let blowwss x = if x == 0 then 0 else (1 + blowwss (x-1)) Prelude> blowwss 1000000 *** Exception: stack overflow
Note that the GHC has a stack size limit solely to prevent endless / unexpectedly deep loops in situations that are most likely programming errors. In principle, the stack can grow indefinitely (constrained by system memory, of course). Even if you specify a large stack size, the stack actually starts much smaller, but can grow to the limit. There is currently a debate on the possibility of completely eliminating the limit in future versions of the GHC.
source share