Memory blowing up for strict sum/strict foldl in ghci
(http://stackoverflow.com/questions/24838982/memory-blowing-up-for-strict-sum-strict-foldl-in-ghci)
Suppose we have
--Test.hs
import Data.List
longList::[Int]
longList = [1 .. ]
result :: Int
result = foldl' (+) 0 $ takeWhile (< 10000000) longList
main = do
print $ result
If one deletes all the ".hi" and ".o" files and then loads into ghci via :
ghci -fobject-code Test.hs
then upon running "main" the memory blows up.