With the wealth of type information available why can\'t Haskell runtimes avoid running GC to clean up? It should be possible to figure out all usages and insert appropriate cal
Consider the following pseudo-code:
func a = if some_computation a
then a
else 0
To know whether a
is garbage after calling func a
, the compiler has to be able to know the result of some_computation a
. If it could do that in the general case (which requires solving the halting problem), thrn there'd be no need to emit code for this function at all, let alone garbage collect it. Type information is not sufficient.