summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFumiaki Kinoshita <fumiexcel@gmail.com>2019-05-05 13:26:36 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-18 16:00:20 -0400
commitda33f2bb3965bacec25790548d1a9b6812dfeefc (patch)
tree88df2479b0ea3035b5f2571e534298f8e026a3c7
parent62f0213d4db6020a0d1feb8512432dcad36f08de (diff)
downloadhaskell-da33f2bb3965bacec25790548d1a9b6812dfeefc.tar.gz
Add more newtype-derived instances to Data.Ord.Down
Metric Increase: haddock.base
-rw-r--r--libraries/base/Data/Ord.hs26
-rw-r--r--libraries/base/changelog.md4
2 files changed, 26 insertions, 4 deletions
diff --git a/libraries/base/Data/Ord.hs b/libraries/base/Data/Ord.hs
index 29f4fb3582..4ccfa7c6b4 100644
--- a/libraries/base/Data/Ord.hs
+++ b/libraries/base/Data/Ord.hs
@@ -7,7 +7,7 @@
-- Module : Data.Ord
-- Copyright : (c) The University of Glasgow 2005
-- License : BSD-style (see the file libraries/base/LICENSE)
---
+--
-- Maintainer : libraries@haskell.org
-- Stability : stable
-- Portability : portable
@@ -23,12 +23,18 @@ module Data.Ord (
comparing,
) where
+import Data.Bits (Bits, FiniteBits)
+import Foreign.Storable (Storable)
+import GHC.Arr (Ix)
import GHC.Base
-import GHC.Show
-import GHC.Read
+import GHC.Enum (Bounded, Enum)
+import GHC.Float (Floating, RealFloat)
import GHC.Num
+import GHC.Read
+import GHC.Real (Fractional, Integral, Real, RealFrac)
+import GHC.Show
--- |
+-- |
-- > comparing p x y = compare (p x) (p y)
--
-- Useful combinator for use in conjunction with the @xxxBy@ family
@@ -54,6 +60,18 @@ newtype Down a = Down
, Num -- ^ @since 4.11.0.0
, Semigroup -- ^ @since 4.11.0.0
, Monoid -- ^ @since 4.11.0.0
+ , Bits -- ^ @since 4.14.0.0
+ , Bounded -- ^ @since 4.14.0.0
+ , Enum -- ^ @since 4.14.0.0
+ , FiniteBits -- ^ @since 4.14.0.0
+ , Floating -- ^ @since 4.14.0.0
+ , Fractional -- ^ @since 4.14.0.0
+ , Integral -- ^ @since 4.14.0.0
+ , Ix -- ^ @since 4.14.0.0
+ , Real -- ^ @since 4.14.0.0
+ , RealFrac -- ^ @since 4.14.0.0
+ , RealFloat -- ^ @since 4.14.0.0
+ , Storable -- ^ @since 4.14.0.0
)
-- | This instance would be equivalent to the derived instances of the
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 5b874b4c7e..5256730529 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -7,6 +7,10 @@
* `Data.Ord.Down` now has a field name, `getDown`
+ * Add `Bits`, `Bounded`, `Enum`, `FiniteBits`, `Floating`, `Fractional`,
+ `Integral`, `Ix`, `Real`, `RealFrac`, `RealFloat` and `Storable` instances
+ to `Data.Ord.Down`.
+
* Fix the `integer-gmp` variant of `isValidNatural`: Previously it would fail
to detect values `<= maxBound::Word` that were incorrectly encoded using
the `NatJ#` constructor.