[Haskell-cafe] Strange space leak
Tom Ellis
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Fri Nov 4 14:58:32 UTC 2016
On Fri, Nov 04, 2016 at 02:44:00PM +0000, Tom Ellis wrote:
> Can anyone explain why this leaks space:
>
> main :: IO ()
> main = let loop () = return () *> loop ()
> in loop ()
>
> whilst this doesn't:
>
> main :: IO ()
> main = let loop = return () *> loop
> in loop
More strangely, the space leak only appears in ghci (and runhaskell). When
compiled there is no such space leak.
Tom
More information about the Haskell-Cafe
mailing list