Created
September 3, 2012 13:05
-
-
Save kawakami-o3/3609211 to your computer and use it in GitHub Desktop.
Stack space overflow: current size 8388608 bytes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum :: Int -> Int | |
sum = sum' 0 | |
where | |
sum' acc n | n<1 = acc | |
| otherwise = sum' (acc+n) (n-1) | |
main = do | |
putStrLn (show (Main.sum (2^24))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ghc main.hs && ./main
[1 of 1] Compiling Main ( main.hs, main.o )
Linking main ...
Stack space overflow: current size 8388608 bytes.
Use `+RTS -Ksize -RTS' to increase it.