On Tue, Mar 20, 2007 at 01:53:47PM +0000, Malcolm Wallace wrote:
> Now, in the definition
>     x = x `seq` foo
> one can also make the argument that, if the value of x (on the lhs of
> the defn) is demanded, then of course the x on the rhs of the defn is
> also demanded.  There is no need for the `seq` here either.
> Semantically, the definition is equivalent to
>     x = foo
> I am arguing that, as a general rule, eliding the `seq` in such a case
> is an entirely valid and correct transformation.

You're talking about demand, WHNF, etc, but the Report doesn't; it
gives a simple denotational semantics for seq and recursive definitions,
according to which the first definition is equivalent to x = _|_.

_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to