I'm cc'ing this to the bug tracker to create a bug for the feature request described below, which came up from an idea of Juliusz...
On Fri, Jan 12, 2007 at 01:19:36AM +0100, Josef Svenningsson wrote: > On 1/11/07, David Roundy <[EMAIL PROTECTED]> wrote: > >I think we'd really like to apply it not to the method, but to the instance > >itself. So that use of the Show instance of Control.Exception.Exception > >would be deprecated. This'd be more severe, since there might be classes > >that depend on a show instance, but don't actually use it. > > > >Another possibility for this particular problem would be to be able to > >rewrite the show instance. If we could just remove the stupid "User > >error:" text from the show instance, I don't think it'd be a bug to use it > >anymore. > > I did a little testing and it turns out that you can actually achieve > what you want. Just write another Show instance for C.E.Exception and > import it wherever there is a possibility that a bad show might be > lurking. GHC will only complain about duplicate instances if you > actually use a method from the Show class with the particular type > which has several instances. So GHC is doing exactly what you want! Cool! (I would have expected it to cause trouble even when we don't use show.) I think this'd be a great little cleanup. We could put the import in impossible.h, which is #included almost everywhere. :) For the benefit of the bug tracker, the idea is that we want to avoid using the Show instance of Control.Exception.Exception, which has the disadvantage of sometimes displaying "User error: xxx" when we failed with code such as error "xxx". This isn't the user's fault, and we should never use this show instance (except if we've already checked that the exception is not a UserException or whatever it's called). Adding this code to impossible.h will probably also require fixing a few (bad) uses of show. David _______________________________________________ darcs-devel mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-devel
