
On 11-11-2014 04:40, Andreas Abel wrote:
+1 for providing an easy way to install an exception handler that uses the display function.
You could consider to just provide
displayExceptionHandler :: SomeException -> IO ()
Even better, why not stderrExceptionHandler :: (SomeException -> String) -> SomeException -> IO () Then it's trivial to define: defaultExceptionHandler = stderrExceptionHandler show displayExceptionHandler = stderrExceptionHandler display Or anything else you may want, for that matter. In particular: foobarExceptionHandler = stderrExceptionHandler mkMsg where ruler = replicate 60 '-' mkMsg exc = unlines [ ruler , "Sorry, an unexpected error occurred. Please " , "file an issue at https://bugs.example.com/" , "with the following message attached:" , ruler , display exc -- Use both for , show exc -- good measure :P. , ruler ] An easy way of installing a custom exception handler that directs the user towards the application's developers :). Cheers, -- Felipe.