Another question about sharing

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Mon, 10 Dec 2001 13:33:33 +0000


> If I have..
> 	data Path = L Path | R Path | T
> 	paths = T : branch paths
> 	branch (p:ps) = L p : R p : branch ps
> 
> This will be a CAF which can never be garbage collected, but
> may grow indefinitely large as it gets reduced. Correct?

Any decent compiler will garbage collect the CAF when it is no
longer needed.  However, this does not solve the problem that the
CAF could grow very large whilst its value is still required.

Regards,
    Malcolm