
27 Oct
2005
27 Oct
'05
1:28 p.m.
Hello,
On 10/27/05, Tom Hawkins
...
data Expr = Constant Int | Addition Expr Expr
cyclic :: Expr cyclic = Addition (Constant 1) cyclic ... And there is nothing that says that your definition of cyclic will actually have a cycle in the implementation.
Would you elaborate? Are you referring to the possibility that "cyclic", or at least the second Addition operand, may not be evaluated?
An implementation that does not do updating of values (i.e. uses "call by name" instead of "call by need") will not generate a cyclic structure; instead every time you ask for the value of "cyclic" it will create a new expression. -Iavor