
6 Sep
2013
6 Sep
'13
3:31 p.m.
On Wed, Sep 04, 2013 at 04:35:17PM +0100, Tom Ellis wrote:
As an addendum to the recent discussion, can anyone explain why main crashes quickly with a stack overflow, whereas main' is happy to print "Hi" for ages (eventually crashing due to an out of memory condition)?
bignum = 100 * 1000 * 1000 main = replicateM bignum (return ()) main' = replicateM bignum (putStrLn "Hi")
FYI, rwbarton on Reddit produced a nice answer: http://www.reddit.com/r/haskell/comments/1luan1/strange_io_sequence_behaviou...