D.Tweed wrote:

> 
> Marko Schuetz wrote:
> 
> > What I would like to know is: wouldn't it make sense to have the
> > transformation
> > 
> > f x = e where e does not mention x
> > 
> > -->
> > 
> > f x = f'
> > f' = e
> > 
> > in hugs? Did I miss anything?
> 
> What if e if huge (maybe an infinte list of primes) and f x is used only
> very rarely during the evaluation? Doesn't this force as much of f' as has
> ever been evaluated due to functions using f x to be constantly in
> memory, or is that a wrong reading of the situation? 
> 

I think that the transformation is exactly fully laziness. Sometimes, it
helps to improve space/time performance, but it needs to be tunned up
due to the reasons including one given by Tweed. I don't think Hugs do
fully laziness transformation, because Hugs uses G-machine and it requires
lambda lifting which flattens the tree-like let structure in the program. 

Kwanghoon Choi



Reply via email to