containers icon indicating copy to clipboard operation
containers copied to clipboard

Cannot silence deprecation of `Data.IntMap.showTree` (PVP violation?)

Open andreasabel opened this issue 3 years ago • 4 comments

It seems that I cannot silence the warning

Warning:
    In the use of ‘MD.showTree’
    (imported from Data.IntMap, but defined in containers-0.5.10.2:Data.IntMap.Internal.DeprecatedDebug):
    Deprecated: "These debugging functions will be removed from this module. They are available from Data.IntMap.Internal.Debug."

with a MIN_VERSION_containers conditional as in:

#if MIN_VERSION_containers(0,5,11)
import qualified Data.IntMap.Internal.Debug as MD
#else
import qualified Data.IntMap as MD
#endif

I would need MIN_VERSION_containers(0,5,10,2) because Data.IntMap.Internal.Debug and the deprecation warning for Data.IntMap.showTree were both introduced in the patch-level release 0.5.10.2. However, there is no 4-ary version of MIN_VERSION_foo. So, maybe 0.5.10.2 violates the PVP?

In the wild:

  • https://github.com/haskell-hvr/regex-tdfa/issues/21
  • https://github.com/haskell-hvr/regex-tdfa/pull/39
  • Affects GHC 8.2.2: https://github.com/haskell-hvr/regex-tdfa/runs/7355913740?check_suite_focus=true#step:18:27

andreasabel avatar Jul 15 '22 09:07 andreasabel

In fact, https://pvp.haskell.org/ classifies a deprecation even as a major version bump (0.5.10.1 -> ~~0.5.10.2~~ 0.6):

Deprecation. Deprecated entities (via a DEPRECATED pragma) SHOULD be counted as removed for the purposes of upgrading the API, because packages that use -Werror will be broken by the deprecation. In other words the new A.B SHOULD be greater than the previous A.B.

andreasabel avatar Jul 17 '22 04:07 andreasabel

@andreasabel

In fact, https://pvp.haskell.org/ classifies a deprecation even as a major version bump (0.5.10.1 -> ~0.5.10.2~ 0.6):

The PVP was revised on this issue, see https://github.com/haskell/pvp/issues/12.

sjakobi avatar Jul 21 '22 23:07 sjakobi

I agree with the assessment that v0.5.10.2 violates the PVP though. I'm not sure what could be done about this now – would deprecating that release help?!

sjakobi avatar Jul 21 '22 23:07 sjakobi

I don't think anything can be done about it, as 0.5.10.2 is the version bundled with GHC 8.2.2. I just wanted to point out this violation of the PVP so one can learn from it (e.g. I myself learned from it...).

andreasabel avatar Jul 22 '22 07:07 andreasabel