So, I did one more experiment, and the following overflows too:

import System.Random
import Data.List

randFloats :: [Float]
randFloats = randoms (mkStdGen 0)

main = print $ sum $ sort $ take 1000000 randFloats

Could it be that Data.List.sort is the culprit that uses O(n) stack space here? If so, is this avoidable?

Thanks a lot,
Milos



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to