
16 Apr
2009
16 Apr
'09
7:23 a.m.
Eugene Kirpichov wrote:
The parameterless version is a top-level definition and won't get garbage-collected, IIRC.
This has not-much to do with CAFs and is really just about scope + values + liveness. live values (those which a program still refers to, e.g. from a function which might get called in the future) don't get GCed. CAFs are just in the top-most scope and particularly likely to get held live in this fashion. As Lennart points out, optimisations occasionally increase sharing, although GHC tries fairly hard not to do this. Jules