
27 Sep
2006
27 Sep
'06
6:02 p.m.
On 9/27/06, Chad Scherrer
I was reading on p. 29 of "A History of Haskell" (a great read, by the way) about the controversy of adding seq to the language. But other than for efficiency reasons, is there really any new primitive that needs to be added to support this?
As long as the compiler doesn't optimize it away, why not just do something like this (in ghci)?
Prelude> let sq x y = if x == x then y else y Prelude> 1 `sq` 2 2 Prelude> (length [1..]) `sq` 2 Interrupted.
There must be a subtlety I'm missing, right?
What if the types are not instances of Eq? Jason