[Haskell-cafe] Re: Nested unsafePerformIO?

2010-04-08 Thread Ertugrul Soeylemez
DavidA wrote: > I am having difficulty debugging a troublesome stack overflow, which I > think might be related to calling unsafePerformIO from within the IO > monad. > > [...] > > f x = unsafePerformIO $ do > m <- randomRIO (1,2) > return (m+x) As a side note you don't need unsafePerfor

[Haskell-cafe] Re: Nested unsafePerformIO?

2010-04-08 Thread DavidA
Bas van Dijk gmail.com> writes: > > It looks like your timedIterateIO is too lazy. > > Try evaluating the 'y' before calling timedIterateIO' again as in: > > let y = f x > ... y `seq` timedIterateIO' t0 y > Thank you, that appears to do the trick. I'm still a bit puzzled about why the prob