Re: [Haskell-cafe] Expressing seq

2006-09-28 Thread Janis Voigtlaender
Chad Scherrer wrote: There must be a subtlety I'm missing, right? What if the types are not instances of Eq? Jason Thanks, I figured it was something simple. Now I just to convince myself there's no way around that. Is there a proof around somewhere? Yes, there is a proof that seq ::

[Haskell-cafe] Expressing seq

2006-09-27 Thread 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

Re: [Haskell-cafe] Expressing seq

2006-09-27 Thread Jason Dagit
On 9/27/06, Chad Scherrer [EMAIL PROTECTED] wrote: 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

Re: [Haskell-cafe] Expressing seq

2006-09-27 Thread Chad Scherrer
There must be a subtlety I'm missing, right? What if the types are not instances of Eq? Jason Thanks, I figured it was something simple. Now I just to convince myself there's no way around that. Is there a proof around somewhere? -- Chad Scherrer Time flies like an arrow; fruit flies

Re: [Haskell-cafe] Expressing seq

2006-09-27 Thread Chris Kuklewicz
Chad Scherrer wrote: 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

Re: [Haskell-cafe] Expressing seq

2006-09-27 Thread Bertram Felgenhauer
Chad Scherrer wrote: 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? Two, at least: First, your sq has a different type, as it requires an Eq instance: Prelude :t sq sq :: (Eq a) = a -