
#12804: forever contains a space leak -------------------------------------+------------------------------------- Reporter: tomjaguarpaw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 8.0.1 libraries/base | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Runtime Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 4.9.0.0's `forever` (implemented in terms of `Applicative`) has a space leak for certain base `Monad`s. The old `forever` (implemented in terms of `Monad`) does not. See these messages for details * https://mail.haskell.org/pipermail/haskell-cafe/2016-October/125177.html * https://mail.haskell.org/pipermail/haskell-cafe/2016-October/125178.html * https://mail.haskell.org/pipermail/haskell- cafe/2016-November/125443.html This is not necessarily `forever`'s fault. It seems likely that the broken behaviour that occurs with `ReaderT` and `StateT` (on `IO`) could be fixed by a specialised implementation of `*>` (for `ReaderT` and `StateT`). Perhaps, then, this bug should ultimately be fixed in `transformers` (and various other packages which supply `Applicative`s) but it is a regression introduced by base-4.9.0.0 so I think it's worthwhile to discuss here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12804 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler