Add whole-package deprecation warnings
With GHC-6.12 if you use base 3 you get:
Warning: Module `Prelude' is deprecated:
[You are using an old version of base. Future
GHC versions will not support this version, so you need to
update your code to use the new base version.]
This is initially a somewhat confusing warning. We're not really deprecating the Prelude!
It would be much nicer if it told us:
Warning: Package `base-3.0.3.2' is deprecated:
[You are using an old version of base. Future
GHC versions will not support this version, so you need to
update your code to use the new base version.]
The message itself could be formatted more nicely too. Patch attached for that.
Note the current spurious list syntax in the deprecation message. I've re-opened #3303 (closed) about that.
As for the syntax for package deprecations, how about just
module Foo {-# DEPRECATED package "the message" #-} (..) where
For the behaviour, how about making them behave just like module-deprecation messages in that one attaches them to a module header and they are only triggered if you import that module. The only change would be in how the message is reported; instead of saying the module is deprecated it'd give the package (including the full version).
I know this is a feature request, which usually we'd want to put off for the next major version, but since this one is all about helping maintainers and users of 6.12.1 and .2, I hope that we consider looking at it for an early 6.12 release.
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.1 RC1 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |