Bindings and Space leaks

Malcolm Wallace
Wed, 4 Jul 2001 14:06:25 +0100

> 1. Is there something like a strict "let!" for avoiding function
> closures by forcing strict evaluation (to headnormalform) of local
> declarations?

Not that I am aware of.  You must do it explicitly with `seq`.

> 2. In a '93 paper, Jan Sparud describes an implementation technique
> for avoiding space leaks when tuples are returned as function result,
> and the values accessed by pattern matching in bindings. The paper
> says this technique (of shorcircuiting all references via a tuple,
> the first time a tuple element is demanded) has been implemented in
> Chalmers LML/HBC compiler. What about other compilers, e.g. GHC?

It is certainly implemented in nhc98, not just for tuples, but for
selectors of any constructed type.