Garbage collection does not fully recover from error

Raymond Boute raymond.boute@pandora.be
Thu, 18 Jul 2002 07:04:41 -0700


L.S.,

Consider the module definition:

//
module Infinite where
x = 1 : map (+1) x
y = 1 : map (+1) y
\\

and the following session

//
Hugs session for:
C:\hugs98\lib\Prelude.hs
D:\TopFolder\Haskexper\Misc\Infinite.hs
Type :? for help
Infinite> take 5 x
[1,2,3,4,5]
Infinite> take 5 x == take 5 y
True
Infinite> x == y

ERROR - Garbage collection fails to reclaim sufficient space
Infinite> take 5 x == take 5 y
True
ERROR - Garbage collection fails to reclaim sufficient space
Infinite>
\\

The first evaluation of
    take 5 x == take 5 y
causes no problems, but after the stack overflow caused by evaluating
    x == y
the second evaluation of
    take 5 x == take 5 y
returns the correct answer but also an error message.

Please let me know
    (i) whether this should be expected,
    (ii) if so, why,
    (iii) if not, how this can be corrected.

Regards,

Raymond Boute