[Git][ghc/ghc][wip/jeltsch/stability-risk-3-module-deprecation] Deprecate all `base` modules with stability risk 3
Wolfgang Jeltsch pushed to branch wip/jeltsch/stability-risk-3-module-deprecation at Glasgow Haskell Compiler / GHC Commits: 94f74140 by Wolfgang Jeltsch at 2026-03-27T18:11:07+02:00 Deprecate all `base` modules with stability risk 3 This contribution implements CLC proposal #392. It marks the following modules as deprecated: * GHC.Event.TimeOut * GHC.Float.RealFracMethods * GHC.GHCi * GHC.GHCi.Helpers * GHC.IO.Handle.Internals * GHC.IO.Handle.Types * GHC.IO.SubSystem * System.Posix.Internals See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context. - - - - - 11 changed files: - libraries/base/changelog.md - libraries/base/src/GHC/Event/TimeOut.hs - libraries/base/src/GHC/Float/RealFracMethods.hs - libraries/base/src/GHC/GHCi.hs - libraries/base/src/GHC/GHCi/Helpers.hs - libraries/base/src/GHC/IO/Handle/Internals.hs - libraries/base/src/GHC/IO/Handle/Types.hs - libraries/base/src/GHC/IO/SubSystem.hs - libraries/base/src/System/IO/OS.hs - libraries/base/src/System/Posix/Internals.hs - + libraries/base/tests/T23697.stderr Changes: ===================================== libraries/base/changelog.md ===================================== @@ -28,6 +28,16 @@ * Hide implementation details when throwing exceptions in throw and throwSTM. ([CLC proposal #387](https://github.com/haskell/core-libraries-committee/issues/387)) * Change `hIsReadable` and `hIsWritable` such that they always throw a respective exception when encountering a closed or semi-closed handle, not just in the case of a file handle. ([CLC proposal #371](github.com/haskell/core-libraries-committee/issues/371)) * Annotate `onException` continuation with `WhileHandling`. ([CLC Proposal #397](https://github.com/haskell/core-libraries-committee/issues/397)) + * Declare the following modules deprecated, and announce that they will be removed in GHC 10.2: + - GHC.Event.TimeOut + - GHC.Float.RealFracMethods + - GHC.GHCi + - GHC.GHCi.Helpers + - GHC.IO.Handle.Internals + - GHC.IO.Handle.Types + - GHC.IO.SubSystem + - System.Posix.Internals + ([CLC Proposal #392](https://github.com/haskell/core-libraries-committee/issues/392)) ## 4.22.0.0 *TBA* * Shipped with GHC 9.14.1 ===================================== libraries/base/src/GHC/Event/TimeOut.hs ===================================== @@ -1,10 +1,12 @@ +{-# LANGUAGE CPP #-} + -- | -- Module : GHC.Event.TimeOut -- Copyright : (c) Tamar Christina 2018 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org --- Stability : stable +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable -- -- Common Timer definitions shared between WinIO and RIO. @@ -14,7 +16,12 @@ -- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can -- change rapidly without much warning. +#if __GLASGOW_HASKELL__ >= 1002 +#error "GHC.Event.TimeOut should be removed in GHC 10.02." +#endif + module GHC.Event.TimeOut + {-# DEPRECATED "GHC.Event.TimeOut is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} ( TimeoutQueue , TimeoutCallback , TimeoutEdit ===================================== libraries/base/src/GHC/Float/RealFracMethods.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} @@ -8,7 +10,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs@haskell.org --- Stability : internal +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable (GHC Extensions) -- -- Methods for the RealFrac instances for 'Float' and 'Double', @@ -22,7 +24,12 @@ -- change rapidly without much warning. -- +#if __GLASGOW_HASKELL__ >= 1002 +#error "GHC.Float.RealFracMethods should be removed in GHC 10.02." +#endif + module GHC.Float.RealFracMethods + {-# DEPRECATED "GHC.Float.RealFracMethods is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} (-- * Double methods -- ** Integer results properFractionDoubleInteger, ===================================== libraries/base/src/GHC/GHCi.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# OPTIONS_HADDOCK not-home #-} -- | @@ -7,7 +9,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs@haskell.org --- Stability : internal +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable (GHC Extensions) -- -- The GHCi Monad lifting interface. @@ -20,8 +22,12 @@ -- change rapidly without much warning. -- +#if __GLASGOW_HASKELL__ >= 1002 +#error "GHC.GHCi should be removed in GHC 10.02." +#endif + module GHC.GHCi - {-# WARNING "This is an unstable interface." #-} + {-# DEPRECATED "GHC.GHCi is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} (GHCiSandboxIO(..), NoIO() ) where ===================================== libraries/base/src/GHC/GHCi/Helpers.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} -- | @@ -7,7 +9,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs@haskell.org --- Stability : internal +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable (GHC Extensions) -- -- Various helpers used by the GHCi shell. @@ -18,7 +20,12 @@ -- change rapidly without much warning. -- +#if __GLASGOW_HASKELL__ >= 1002 +#error "GHC.GHCi.Helpers should be removed in GHC 10.02." +#endif + module GHC.GHCi.Helpers + {-# DEPRECATED "GHC.GHCi.Helpers is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} (disableBuffering, flushAll, evalWrapper ===================================== libraries/base/src/GHC/IO/Handle/Internals.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} @@ -8,7 +10,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : libraries@haskell.org --- Stability : internal +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable -- -- This module defines the basic operations on I\/O \"handles\". All @@ -21,7 +23,12 @@ -- change rapidly without much warning. -- +#if __GLASGOW_HASKELL__ >= 1002 +#error "GHC.IO.Handle.Internals should be removed in GHC 10.02." +#endif + module GHC.IO.Handle.Internals + {-# DEPRECATED "GHC.IO.Handle.Internals is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} (withHandle, withHandle', withHandle_, ===================================== libraries/base/src/GHC/IO/Handle/Types.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} @@ -7,7 +9,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : libraries@haskell.org --- Stability : internal +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable -- -- Basic types for the implementation of IO Handles. @@ -18,7 +20,12 @@ -- change rapidly without much warning. -- +#if __GLASGOW_HASKELL__ >= 1002 +#error "GHC.IO.Handle.Types should be removed in GHC 10.02." +#endif + module GHC.IO.Handle.Types ( + {-# DEPRECATED "GHC.IO.Handle.Types is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} Handle(..), Handle__(..), showHandle, checkHandleInvariants, BufferList(..), ===================================== libraries/base/src/GHC/IO/SubSystem.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} -- | @@ -7,7 +9,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : libraries@haskell.org --- Stability : internal +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable -- -- The 'IoSubSystem' control interface. These methods can be used to disambiguate @@ -19,7 +21,12 @@ -- change rapidly without much warning. -- +#if __GLASGOW_HASKELL__ >= 1002 +#error "GHC.IO.SubSystem should be removed in GHC 10.02." +#endif + module GHC.IO.SubSystem + {-# DEPRECATED "GHC.IO.SubSystem is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} (withIoSubSystem, withIoSubSystem', whenIoSubSystem, ===================================== libraries/base/src/System/IO/OS.hs ===================================== @@ -47,12 +47,12 @@ import GHC.IO.Windows.Handle toHANDLE ) #endif -import GHC.IO.Handle.Types +import GHC.Internal.IO.Handle.Types ( Handle (FileHandle, DuplexHandle), Handle__ (Handle__, haDevice) ) -import GHC.IO.Handle.Internals (withHandle_', flushBuffer) +import GHC.Internal.IO.Handle.Internals (withHandle_', flushBuffer) import GHC.IO.Exception ( IOErrorType (InappropriateType), ===================================== libraries/base/src/System/Posix/Internals.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} @@ -7,7 +9,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs@haskell.org --- Stability : internal +-- Stability : deprecated (<https://github.com/haskell/core-libraries-committee/issues/392>) -- Portability : non-portable (requires POSIX) -- -- POSIX support layer for the standard libraries. @@ -23,7 +25,12 @@ -- * S_ISSOCK (no sockets in POSIX) -- +#if __GLASGOW_HASKELL__ >= 1002 +#error "System.Posix.Internals should be removed in GHC 10.02." +#endif + module System.Posix.Internals + {-# DEPRECATED "System.Posix.Internals is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." #-} ( module GHC.Internal.System.Posix.Internals -- TODO: deprecate ) where ===================================== libraries/base/tests/T23697.stderr ===================================== @@ -0,0 +1,3 @@ +T23697.hsc:11:1: warning: [GHC-15328] [-Wdeprecations (in -Wextended-warnings)] + Module ‘System.Posix.Internals’ is deprecated: + "System.Posix.Internals is deprecated and will be removed in GHC 10.02. See https://github.com/well-typed/reinstallable-base/tree/main/hackage-uses-of-i... for context." View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/94f741404bebb89db102f761aa7c4a02... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/94f741404bebb89db102f761aa7c4a02... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)