Mark a reexport as deprecated on the package level
This is the companion of #4879 (closed), for the same problem on a different level.
Motivation
See https://github.com/ghc-proposals/ghc-proposals/discussions/489, from @trac-gershomb. Sometimes, modules were historically provided in some packages, but after various reorganizations should be only gotten from other packages. This has come up with Cabal
, mtl
, and perhaps someday (#20647 (closed)) base
.
Rather than have a hard removal of the export, it would be nice to give downstream code forwarning with a deprecation cycle. That would nudge them to adjust their library dependencies before any breakage actually occurred.
Proposal
Because this is the GHC repo, we are ignoring Cabal files and just thinking about the underlying GHC files.
Package files (foo.conf
) today can have a list a (regular) module reexports. To implement this, they would also need to suport a list of module deprecated reexports with messages.
-
import Foo
gets a warning ifFoo
can only be found in dependencies (as specified by-package-id
flags or similar) where it is reexported deprecated. Each such deprecation message is printed. -
import "bar" Foo
gets a warning if packagebar
reexportsFoo
deprecated, even if the package also depends on the library where it is exported non-deprecated.