[Git][ghc/ghc][wip/CLC208] 4 commits: ghc-internal: Drop GHC.Internal.Data.Enum
Ben Gamari (@bgamari)
gitlab at gitlab.haskell.org
Tue Oct 1 13:55:26 UTC 2024
Ben Gamari pushed to branch wip/CLC208 at Glasgow Haskell Compiler / GHC
Commits:
e5af3aed by Ben Gamari at 2024-10-01T09:54:56-04:00
ghc-internal: Drop GHC.Internal.Data.Enum
This module consists only of reexports and consequently there is no
reason for it to exist.
- - - - -
05ea7a82 by Ben Gamari at 2024-10-01T09:54:56-04:00
base: Introduce Data.Bounded
As proposed in [CLC#208] but unfortunately `Data.Enum` was already
incorrectly introduced in the `ghc-internal` refactor.
[CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208
- - - - -
271cf64f by Ben Gamari at 2024-10-01T09:54:56-04:00
base: Deprecate export of Bounded from Data.Enum
This begins the process of bringing us into compliance with
[CLC#208].
[CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208
- - - - -
f09d35dd by Ben Gamari at 2024-10-01T09:54:56-04:00
base: Mention incorrect Data.Enum addition in changelog
- - - - -
7 changed files:
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/ghc-internal/src/GHC/Internal/Data/Enum.hs → libraries/base/src/Data/Bounded.hs
- libraries/base/src/Data/Enum.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- testsuite/tests/interface-stability/base-exports.stdout
Changes:
=====================================
libraries/base/base.cabal.in
=====================================
@@ -46,8 +46,10 @@ Library
, Data.Bifoldable1
, Data.Bifunctor
, Data.Bitraversable
+ , Data.Bounded
, Data.Char
, Data.Complex
+ , Data.Enum
, Data.Fixed
, Data.Foldable1
, Data.Functor.Classes
@@ -95,7 +97,6 @@ Library
, Data.Dynamic
, Data.Either
, Data.Eq
- , Data.Enum
, Data.Foldable
, Data.Function
, Data.Functor
=====================================
libraries/base/changelog.md
=====================================
@@ -22,9 +22,11 @@
and [CLC proposal #261](https://github.com/haskell/core-libraries-committee/issues/261))
* The [deprecation process of GHC.Pack](https://gitlab.haskell.org/ghc/ghc/-/issues/21461) has come its term. The module has now been removed from `base`.
* Propagate HasCallStack from `errorCallWithCallStackException` to exception backtraces, fixing a bug in the implementation of [CLC proposal #164](https://github.com/haskell/core-libraries-committee/issues/164).
+ * Introduce `Data.Bounded` module exporting the `Bounded` typeclass ([CLC proposal #208](https://github.com/haskell/core-libraries-committee/issues/208))
-## 4.20.0.0 May 2024
+## 4.20.0.0 *May 2024*
* Shipped with GHC 9.10.1
+ * Introduce `Data.Enum` module exporting both `Enum` and `Bounded`. Note that the export of `Bounded` will be deprecated in a future release ([CLC proposal #208](https://github.com/haskell/core-libraries-committee/issues/208))
* Deprecate `GHC.Pack` ([#21461](https://gitlab.haskell.org/ghc/ghc/-/issues/21461))
* Export `foldl'` from `Prelude` ([CLC proposal #167](https://github.com/haskell/core-libraries-committee/issues/167))
* The top-level handler for uncaught exceptions now displays the output of `displayException` rather than `show` ([CLC proposal #198](https://github.com/haskell/core-libraries-committee/issues/198))
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Enum.hs → libraries/base/src/Data/Bounded.hs
=====================================
@@ -2,21 +2,23 @@
-----------------------------------------------------------------------------
-- |
--- Module : GHC.Internal.Data.Enum
+-- Module : Data.Enum
-- Copyright : (c) The University of Glasgow, 1992-2002
-- License : see libraries/base/LICENSE
--
--- Maintainer : ghc-devs at haskell.org
+-- Maintainer : cvs-ghc at haskell.org
-- Stability : stable
-- Portability : non-portable (GHC extensions)
--
--- The 'Enum' and 'Bounded' classes.
+-- The 'Bounded' classes.
+--
+-- @since 4.21.0.0
--
-----------------------------------------------------------------------------
-module GHC.Internal.Data.Enum
+module Data.Bounded
( Bounded(..)
- , Enum(..)
) where
-import GHC.Internal.Enum
+import GHC.Enum
+
=====================================
libraries/base/src/Data/Enum.hs
=====================================
@@ -1,7 +1,7 @@
-{-# LANGUAGE Safe #-}
+{-# LANGUAGE NoImplicitPrelude #-}
+-----------------------------------------------------------------------------
-- |
---
-- Module : Data.Enum
-- Copyright : (c) The University of Glasgow, 1992-2002
-- License : see libraries/base/LICENSE
@@ -10,12 +10,16 @@
-- Stability : stable
-- Portability : non-portable (GHC extensions)
--
--- The 'Enum' and 'Bounded' classes.
+-- The 'Enum' class.
+--
+-- @since 4.20.0.0
--
+-----------------------------------------------------------------------------
module Data.Enum
- (Bounded(..),
- Enum(..)
- ) where
+ ( Enum(..)
+ {-# DEPRECATED "Bounded should be imported from Data.Bounded" #-}
+ , Bounded(..)
+ ) where
-import GHC.Internal.Data.Enum
\ No newline at end of file
+import GHC.Internal.Enum
=====================================
libraries/ghc-internal/ghc-internal.cabal.in
=====================================
@@ -117,7 +117,6 @@ Library
GHC.Internal.Data.Dynamic
GHC.Internal.Data.Either
GHC.Internal.Data.Eq
- GHC.Internal.Data.Enum
GHC.Internal.Data.Foldable
GHC.Internal.Data.Function
GHC.Internal.Data.Functor
=====================================
libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
=====================================
@@ -18,7 +18,7 @@ import GHC.Generics (Generic)
import GHC.Internal.Base
import GHC.Internal.Show
import GHC.Internal.Generics
-import GHC.Internal.Data.Enum
+import GHC.Internal.Enum
#endif
-- | The language extensions known to GHC.
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -744,6 +744,14 @@ module Data.Bool where
otherwise :: Bool
(||) :: Bool -> Bool -> Bool
+module Data.Bounded where
+ -- Safety: Safe-Inferred
+ type Bounded :: * -> Constraint
+ class Bounded a where
+ minBound :: a
+ maxBound :: a
+ {-# MINIMAL minBound, maxBound #-}
+
module Data.Char where
-- Safety: Trustworthy
type Char :: *
@@ -947,7 +955,7 @@ module Data.Either where
rights :: forall a b. [Either a b] -> [b]
module Data.Enum where
- -- Safety: Safe
+ -- Safety: Safe-Inferred
type Bounded :: * -> Constraint
class Bounded a where
minBound :: a
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6f53d832eed89d9d35c60eb11a6d2f6ffa79a567...f09d35dd200e5517688aabde97db4196baa541e4
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6f53d832eed89d9d35c60eb11a6d2f6ffa79a567...f09d35dd200e5517688aabde97db4196baa541e4
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241001/41175030/attachment-0001.html>
More information about the ghc-commits
mailing list