Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move deprecated modules to undeprecated hidden modules #213

Merged
merged 2 commits into from
Dec 3, 2023

Commits on Dec 3, 2023

  1. Deprecate reshuffling part 1: Rename deprecated X.hs -> X.Hidden.hs

    Deprecating the OsString modules in 1.4.200.0 had an unfortunate
    side-effect: every symbol defined in such a module inherited the
    deprecation status, even if the symbol itself was intended to be
    stable.
    
    To work around this, we move the definitions to new, unexposed, and
    non-deprecated .Hidden modules. These definitions are then re-exported
    from the original deprecated modules. This achieves the desired effect
    of:
    
    - Using a deprecated module results in a warning.
    - Using a non-deprecated symbol originally defined in a deprecated
      module does __not__ receive a deprecation warning, provided it is
      imported from a non-deprecated module.
    
    For example, the type EncodingException was originally defined in the
    deprecated module System.OsPath.Encoding.Internal. This meant that
    users would receive a deprecation warning for using it, even if they
    imported it from a non-deprecated module e.g. System.OsPath.Encoding.
    
    System.OsPath.Encoding.Internal has been renamed to the unexposed and
    non-deprecated module System.OsPath.Encoding.Internal.Hidden. The
    old System.OsPath.Encoding.Internal module retains its deprecation
    warning and re-exports System.OsPath.Encoding.Internal.Hidden.
    
    Thus:
    
    - Importing EncodingException from System.OsPath.Encoding incurs no
      warnings.
    - Importing System.OsPath.Encoding.Internal retains its deprecation.
    
    The implementation strategy is, for each deprecated module X:
    
    1. Rename X -> X.Hidden, removing the deprecation.
    2. X now re-exports X.Hidden, adding the deprecation.
    tbidne committed Dec 3, 2023
    Configuration menu
    Copy the full SHA
    93aee47 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b7ed11 View commit details
    Browse the repository at this point in the history