Division by 0 exits ghci

George Russell ger at tzi.de
Tue Sep 17 14:38:47 EDT 2002


In fact the problem is more drastic than I mentioned in my last message; division by 0
doesn't seem to be catchable at all.  From this program
----------- cut here -----------------------
import Exception

main = 
   do
      excep <- Exception.try (seq (1 `div` 0) (return ()))
      putStrLn "Survived"
----------- cut here ----------------------
I get the output "Arithmetic Exception" on Solaris and "Floating point exception" on Linux,
while I think I ought to get "Survived".



More information about the Glasgow-haskell-bugs mailing list