
my setup: phenom II quadcore, 4GB mem Ubuntu Maverick While implementing my own reverse in "99 haskell questions", I made the following mistake: (Caution: stack over flow causing code below) reverse'::[a] -> [a] reverse' [] = [] reverse' [x] = [x] reverse' xs = last xs : init (reverse' xs) The last line is the wrong part. It should be reverse' xs = last xs : reverse' (init xs) anyway, the original code seems to cause an infinite recursion by repeating the last part forever. When I try this out on ghci: *Main> reverse' [1,2,3,4,5] [5*** Exception: stack overflow *Main> The problem is, unless I manually exit ghci, the "stack" does not seem to be freed (garbage collected?) and memory remains fully occupied by ghci. I tried waiting a bit, but it stayed the same. Is this expected behavior? Shouldn't the GC kick in? Is this orthogonal of the GC? I think this would help me understand haskell and GHC much better.