But note that x `seq` x is equivalent to x, even operationally. To see why denotationally, note that if x evaluates to _|_, so does x `seq` x. And if x evaluates to a value v, so does x `seq` x. To see why operationally, consider the two lists:

  let x = 1+1 in [x `seq` x]
  let x = 1+1 in [x]

Using conventional lazy evaluation in both cases, the term "1+1" is not evaluated until the head of the list is taken. In other words, x `seq` x in no way hurries the evaluation of x.

-Paul


Wolfgang Jeltsch wrote:
Am Samstag, 8. November 2003, 00:22 schrieb Hamilton Richards:
Also note that
        if x then True else False
is just a verbose way of writing
        x

Actually, it's just a verbose way of writing x `seq` x, but this detail is, of course, not interesting for beginners.


Wolfgang

_______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to