[Git][ghc/ghc][master] Add more instances for Compose: Enum, Bounded, Num, Real, Integral

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat May 13 12:46:16 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
8a0d45f7 by Bodigrim at 2023-05-13T08:45:58-04:00
Add more instances for Compose: Enum, Bounded, Num, Real, Integral

See https://github.com/haskell/core-libraries-committee/issues/160 for discussion

- - - - -


2 changed files:

- libraries/base/Data/Functor/Compose.hs
- libraries/base/changelog.md


Changes:

=====================================
libraries/base/Data/Functor/Compose.hs
=====================================
@@ -156,3 +156,14 @@ instance (TestEquality f) => TestEquality (Compose f g) where
     case testEquality x y of -- :: Maybe (g x :~: g y)
       Just Refl -> Just Refl -- :: Maybe (x :~: y)
       Nothing   -> Nothing
+
+-- | @since 4.19.0.0
+deriving instance Enum (f (g a)) => Enum (Compose f g a)
+-- | @since 4.19.0.0
+deriving instance Bounded (f (g a)) => Bounded (Compose f g a)
+-- | @since 4.19.0.0
+deriving instance Num (f (g a)) => Num (Compose f g a)
+-- | @since 4.19.0.0
+deriving instance Real (f (g a)) => Real (Compose f g a)
+-- | @since 4.19.0.0
+deriving instance Integral (f (g a)) => Integral (Compose f g a)


=====================================
libraries/base/changelog.md
=====================================
@@ -25,6 +25,7 @@
     adding the class `Unsatisfiable :: ErrorMessage -> TypeError` to `GHC.TypeError`,
     which provides a mechanism for custom type errors that reports the errors in
     a more predictable behaviour than `TypeError`.
+  * Add more instances for `Compose`: `Enum`, `Bounded`, `Num`, `Real`, `Integral` ([CLC proposal #160](https://github.com/haskell/core-libraries-committee/issues/160))
   * Make `(&)` representation polymorphic in the return type ([CLC proposal #158](https://github.com/haskell/core-libraries-committee/issues/158))
   * Implement `GHC.IORef.atomicSwapIORef` via a new dedicated primop `atomicSwapMutVar#` ([CLC proposal #139](https://github.com/haskell/core-libraries-committee/issues/139))
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8a0d45f7d846e92cf4b6641fd8c67606412cdb3a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8a0d45f7d846e92cf4b6641fd8c67606412cdb3a
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/20230513/2fde5938/attachment-0001.html>


More information about the ghc-commits mailing list