There are too many error handling conventions used in library code!

Donald Bruce Stewart dons at cse.unsw.edu.au
Sat Mar 10 19:33:57 EST 2007


This article on the 8 different error handling strategies various common
Haskell libs use:
    http://www.randomhacks.net/articles/2007/03/10/haskell-8-ways-to-report-errors

got me thinking: 

    we need to standardise/recommend a small set of methods for library
    error handling. 

The lack of consistent error reporting between libs results in verbose
code, as we're not able to use a single error handling technique when
gluing together code from different libs (i.e. we can't just use Maybe
or Either/ErrorT). 

(It's always nice when you *can* use, say, a Maybe monad to glue code
from a number of sources, but eventually you reach code with a different
error system, and the Maybe monad breaks down).

So, some questions I think we can tackle:

    * can we identify error handling strategies from the list that should
    not be used anymore? (throwDyn?)
    
    * can we move some of the outlying libraries to a more consistent error framework?

    * do we need more support for gluing together our different error systems?
     (it should be easier to glue code using , say, Maybe/Either). 

    * what role does MonadError play here, as a generic error handler?

    * can we make precise recommendations about which error strategies to use?

-- Don


More information about the Libraries mailing list