| > In ghc-5.00.1, "seq (2/0) 3" gives 3. Should it not give 
| error. Hugs does.
| 
| I suspect that Hugs is wrong and ghc is right in this case. 
| Certainly nhc98 and hbc agree with ghc's behaviour.
|
| seq x y  means evaluate x to whnf and throw away the result, 
| returning y instead.  It shouldn't matter whether the result 
| of x is bottom.

This doesn't seem a correct explaination to me.  seq _|_ anything == _|_

The reason that it doesn't bomb in GHCi, and I presume nhc98 and hbc is
because the type of (2/0) is Fractional a => a, which is defaulted to
Double.  However, 2/0 :: Double is a well defined value -- an IEEE754 
Infinity (try it)!  

I think what Saswat expected to see can be made to happen if you force
the division to be an integer division:

   Prelude> seq (2 `div` 0) 3    
   Floating point exception
   cam-02-unx:~$ 

J

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to