10 Dec
2001
10 Dec
'01
11:18 a.m.
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?
GHC will collect the CAF when it can determine that it is no longer required. In GHCi, the CAF will only be collected if you turn on ':set +r', otherwise evaluated CAFs are retained between evaluations. Cheers, Simon