Skip to content

Instantly share code, notes, and snippets.

@Ericson2314
Last active November 11, 2024 00:27
Show Gist options
  • Select an option

  • Save Ericson2314/58ddea784f19705ef79651c0ad00141c to your computer and use it in GitHub Desktop.

Select an option

Save Ericson2314/58ddea784f19705ef79651c0ad00141c to your computer and use it in GitHub Desktop.
Formally deprecate modules informally marked unstable in #146

Background

In haskell/core-libraries-committee#146 a number of modules (based on @bgamari's spreadsheet were documented as unstable.

However, these modules were not formally deprecated. I am not sure why this didn't happen.

In haskell/core-libraries-committee#295, I am proposing how to eventually remove them entirely, but there is unlikely to be consensus on how to do this imminently.

@bodigrim suggested

What I would suggest is to mark all modules, which were marked as unstable in haskell/core-libraries-committee#146 (comment), as deprecated (at this point without any particular schedule for removal). Then after a couple of GHC releases we will be in good position to decide whether and when to remove them from base

@andreaspk likewise suggests a first step of

Some problematic modules are identified (I agree with the list for the most part) and a decision is made to deprecate them.

I am therefore seeing consensus across CLC members and GHC devs that this is a good first step. Great! let's do it.

Proposal

Deprecate these modules. (Some things in #146 are already deprecated, and thus not included below.)

Deprecated Module Migration
GHC.Arr Use the array package`
GHC.ArrayArray Use GHC.Exts bad suggestion because we want to get rid of that module too, but its what the docs say today
GHC.Conc.IO Use GHC.Conc, or ghc-internal for any unstable bits not in GHC.Conc
GHC.Encoding.UTF8 Use text
GHC.Exception Use Control.Exception, or ghc-internals for anything not in there
GHC.Exception.Type Same advice as for GHC.Exception
GHC.Fingerprint.Type Use GHC.Fingerprint. If it is deprecated as per below, inline those instructions.
GHC.InfoProv Use ghc-internal
GHC.IO.Buffer Use ghc-internal
GHC.IO.Device Use ghc-internal
GHC.IO.Encoding Use ghc-internal
GHC.IO.Exception Use ghc-internal
GHC.IO.Handle.Text Use ghc-internal
GHC.Stack.Types Use GHC.Stack
GHC.TopHandler Use GHC.Conc or ghc-internal
GHC.Event.TimeOut Use ghc-internal
GHC.Float.RealFracMethods Rely on rewrite rules, or use ghc-internal
GHC.GHCi Use ghc-internal
GHC.GHCi.Helpers Use ghc-internal
GHC.IO.Handle.Internals Use GHC.IO.Handle or ghc-internal
GHC.IO.Handle.Types Use GHC.IO.Handle or ghc-internal
GHC.IO.SubSystem Use ghc-internal
GHC.IOPort Use ghc-internal
System.Posix.Internals Use ghc-internal

Appendix: Excluded deprecations

These modules were additionally recommended by @bgamari but not marked in #146. I see no reason why not to deprecate them too, but I am not proposing to do so yet, at @bodigrim's suggestion.

Additional deprecated Module Migration
GHC.Bits Use Data.Bits
GHC.Char Use Data.Char, or regular == and /== from Prelude
GHC.Fingerprint Use Data.Typeable or ghc-internal

These modules were marked deprecated but it doesn't seem prudent to deprecate them at this time.

Exceptions to not yet deprecate Reasons
GHC.Conc Wildely used, no stable replacement yet
GHC.IO Wildely used, no stable replacement yet
GHC.RTS.Flags Handled in #289
GHC.Stats Want to move to ghc-experimental, but can't do deprecrated module reexports yet
GHC.ExecutionStack Want to move to ghc-experimental, but can't do deprecrated module reexports yet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment