[Git][ghc/ghc][wip/CLC208] base: Introduce Data.Bounded

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Sep 27 17:48:15 UTC 2023



Ben Gamari pushed to branch wip/CLC208 at Glasgow Haskell Compiler / GHC


Commits:
51137970 by Ben Gamari at 2023-09-27T13:48:03-04:00
base: Introduce Data.Bounded

As proposed in [CLC#208].

[CLC#208]: https://github.com/haskell/core-libraries-committee/issues/208

- - - - -


4 changed files:

- libraries/base/Data/Enum.hs
- libraries/base/base.cabal
- libraries/base/changelog.md
- testsuite/tests/interface-stability/base-exports.stdout


Changes:

=====================================
libraries/base/Data/Enum.hs
=====================================
@@ -10,13 +10,12 @@
 -- Stability   :  stable
 -- Portability :  non-portable (GHC extensions)
 --
--- The 'Enum' and 'Bounded' classes.
+-- The 'Enum' class.
 --
 -----------------------------------------------------------------------------
 
 module Data.Enum
-    ( Bounded(..)
-    , Enum(..)
+    ( Enum(..)
     ) where
 
 import GHC.Enum


=====================================
libraries/base/base.cabal
=====================================
@@ -121,6 +121,7 @@ Library
         Data.Bitraversable
         Data.Bits
         Data.Bool
+        Data.Bounded
         Data.Char
         Data.Coerce
         Data.Complex


=====================================
libraries/base/changelog.md
=====================================
@@ -5,6 +5,8 @@
   * Add a `RULE` to `Prelude.lookup`, allowing it to participate in list fusion ([CLC proposal #174](https://github.com/haskell/core-libraries-committee/issues/175))
   * The `Enum Int64` and `Enum Word64` instances now use native operations on 32-bit platforms, increasing performance by up to 1.5x on i386 and up to 5.6x with the JavaScript backend. ([CLC proposal #187](https://github.com/haskell/core-libraries-committee/issues/187))
   * Update to [Unicode 15.1.0](https://www.unicode.org/versions/Unicode15.1.0/).
+  * Introduce `Data.Bounded` exporting the `Bounded` typeclass ([CLC proposal #208](https://github.com/haskell/core-libraries-committee/issues/208))
+  * Introduce `Data.Enum` exporting the `Enum` typeclass ([CLC proposal #208](https://github.com/haskell/core-libraries-committee/issues/208))
 
 ## 4.19.0.0 *TBA*
   * Add `{-# WARNING in "x-partial" #-}` to `Data.List.{head,tail}`.


=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -908,11 +908,6 @@ module Data.Either where
 
 module Data.Enum where
   -- Safety: Safe-Inferred
-  type Bounded :: * -> Constraint
-  class Bounded a where
-    minBound :: a
-    maxBound :: a
-    {-# MINIMAL minBound, maxBound #-}
   type Enum :: * -> Constraint
   class Enum a where
     succ :: a -> a



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/511379707371b9ea07ef2c30418cb5ea1f321b8a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/511379707371b9ea07ef2c30418cb5ea1f321b8a
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/20230927/88682d0e/attachment-0001.html>


More information about the ghc-commits mailing list