Dear base and mtl maintainers,
I would like to report a memory leak problem (not sure which haskell
component) when using "forever" in combination with "readerT" or "stateT".
Simple test program to reproduce the problem:
---
import Control.Concurrent
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Trans.Reader
import Control.Monad.Trans.State
main :: IO ()
main = do
-- no leak when using loop1 instead of loop2
--let loop1 = (liftIO $ threadDelay 1) >> loop1
let loop2 = forever (liftIO $ threadDelay 1)
_ <- runStateT (runReaderT loop2 'a') 'b'
return ()
---
I have asked on haskell-cafe, but the analysis is above my haskell
knowledge:
https://mail.haskell.org/pipermail/haskell-cafe/2016- October/125176.html
https://mail.haskell.org/pipermail/haskell-cafe/2016- October/125177.html
https://mail.haskell.org/pipermail/haskell-cafe/2016- October/125178.html
regards,
Zoran