exception classifier functions

Dean Herington heringto@cs.unc.edu
Mon, 28 Oct 2002 11:35:22 -0500


It's unfortunate that the exception classifier functions differ between
GHC and Hugs, even where capabilities overlap.

GHC has:

    ioErrors :: Exception -> Maybe IOError
    arithExceptions :: Exception -> Maybe ArithException
    errorCalls :: Exception -> Maybe String
    dynExceptions :: Exception -> Maybe Dynamic
    assertions :: Exception -> Maybe String
    asyncExceptions :: Exception -> Maybe AsyncException
    userErrors :: Exception -> Maybe String

Hugs has:

    justIoErrors            :: Exception -> Maybe IOError
    justHugsExceptions      :: Exception -> Maybe HugsException

Would greater commonality be possible?


Also, I don't care for the naming scheme for these functions.  While use
of these functions with `catchJust` and `tryJust` reads very well, other
use reads poorly.  Names such as `asIOError`, `asArithException`, etc.,
would better described their interfaces.

 -- Dean