
20 Sep
2007
20 Sep
'07
1:33 a.m.
G'day all.
Quoting PR Stanley
Fully lazy? Can you elaborate please?
Sure. that code again: test1 = \n _ -> 1+n test2 = \n -> let x = n+1 in \_ -> x Suppose we have: f g x = g x + g x And we try two options: f (test1 4) 3 f (test2 4) 3 In the first case, (1+4) will be evaluated twice. In the second case, it will only be evaluated once. Cheers, Andrew Bromage