Proposal: Extensible exceptions

Ian Lynagh igloo at earth.li
Mon Jul 7 11:40:34 EDT 2008


On Sun, Jul 06, 2008 at 02:39:52AM +0300, Yitzchak Gale wrote:
> 
> To get there with less pain, I think we should:
> 
> o For 6.10, make the new Exceptions available so that
>   everyone can start working on switching, but leave old
>   Exceptions as the default so that existing programs still
>   work. Prominently mark old exceptions as deprecated
>   in all documentation.
> 
> o In the next version, make the new Exceptions the default.
>   Make sure that programs using new Exceptions for 6.10
>   will still work (e.g., leave NewException as an alias for
>   Exception, or whatever).

We can do that, although to actually get people to change I think we'd
need a good helping of DEPRECATED pragmas. So in 6.10 we'd have:

    module OldException where ... -- everything has DEPRECATED pragmas
    module NewException where ...
    module Exception (module OldException)
        where import OldException

and then in 6.12:

    module OldException where ... -- everything has DEPRECATED pragmas
    module Exception where ...
    module {-# DEPRECATED "Use Exception" #-} NewException (module Exception)
        where import Exception


Thanks
Ian



More information about the Libraries mailing list