[Haskell-cafe] memory leak when using "forever"
zoran.bosnjak at via.si
Tue Oct 4 11:51:04 UTC 2016
can you please explain why does this simple program leak memory.
But, if I replace loop2 with loop1 (that is: without using "forever"),
then it does not leak.
Is this a problem in "forever" implementation or am I misusing this
In the sources of base:
... there is some mention of memory leak prevention, but it looks like
something is not right in this case.
main :: IO ()
main = do
--let loop1 = (liftIO $ threadDelay 1) >> loop1
let loop2 = forever (liftIO $ threadDelay 1)
_ <- runStateT (runReaderT loop2 'a') 'b'
More information about the Haskell-Cafe