Warnings for unhandled exceptions

L.S., I was reading about the Aardvark language [0] and the robustness they intend to implement in it by, amongst others, catching each possible exception. I wonder, is it possible to implement compiler warnings for unhandled exceptions in Haskell? One of the strong points of Haskell is the type checking and clearly identifying functions with side effects, but exceptions are not reflected by the type of a function. It would be useful if the compiler gave a warning for each type of exception, for each expression, that is not handled by the program. Regards, Henk-Jan van Tuyl [0] http://aardvarklanguage.sourceforge.net/ -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --

An alternative to exceptions would be to use ADTs to wrap return values, e.g. Maybe, Either. Static analysis is much easier with these.
–
Kyle Marek-Spartz
On Sep 9, 2014, 7:38:34 AM, Henk-Jan van Tuyl

On Tue, Sep 9, 2014 at 8:38 AM, Henk-Jan van Tuyl
It would be useful if the compiler gave a warning for each type of exception, for each expression, that is not handled by the program.
A problem with this idea is that some exceptions can be potentially thrown by any expression at any time, based solely on things external to the program, compiler or runtime. Only software exceptions can reliably be handled this way --- and those arguably should not be implemented as exceptions, but as e.g. Maybe/Either/etc. (Floating point exceptions are, as usual for IEEE floating point, a weird corner case.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Hello. There is an implementation of Java-like "checked exceptions" for Haskell: http://hackage.haskell.org/package/control-monad-exception :) On 09.09.2014 18:38, Henk-Jan van Tuyl wrote:
L.S.,
I was reading about the Aardvark language [0] and the robustness they intend to implement in it by, amongst others, catching each possible exception. I wonder, is it possible to implement compiler warnings for unhandled exceptions in Haskell? One of the strong points of Haskell is the type checking and clearly identifying functions with side effects, but exceptions are not reflected by the type of a function. It would be useful if the compiler gave a warning for each type of exception, for each expression, that is not handled by the program.
Regards, Henk-Jan van Tuyl
participants (4)
-
Brandon Allbery
-
Henk-Jan van Tuyl
-
Ilya Portnov
-
Kyle Marek-Spartz