On Thu, Mar 26, 2009 at 2:40 AM, Duncan Coutts <[email protected]> wrote: > I was not being precise when I said "tests for _|_". As you point out, > the semantics of imprecise exceptions distinguishes exceptions from > bottom, however pure code cannot make that distinction and so that's why > I was lumping them together and saying that tryArith tests for certain > kinds of _|_ value.
Right... I had this mental picture of exceptions being values denotationally smaller than any "real" value of the domain before I read the imprecise exceptions paper, so I interpreted your imprecise description that way =) > Anyway, I hope this is enough to dissuade people from using > unsafePerformIO to catch exceptions. Yes, unfortunately you can't even use it to return Nothing on errors (ie without returning the specific exception) because of the (overflow + loop) issue where you have nondeterminism between returning Nothing and looping forever. I have my own history of wondering "why isn't there in Control.Exception a function that..." for a while before figuring out why there isn't :-) - Benja _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
