diff options
author | konsumlamm <konsumlamm@gmail.com> | 2022-07-02 15:10:55 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-03 14:12:11 -0400 |
commit | 2635c6f2bfb3d1126fa868768fc4b8349d0b9950 (patch) | |
tree | 77408fb76139b3354acf3462e0a36e66b39629f7 | |
parent | c43dbac08b0d56406fe13de1e9b49c944f478b4a (diff) | |
download | haskell-2635c6f2bfb3d1126fa868768fc4b8349d0b9950.tar.gz |
Expand `Ord` instance for `Down`
Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/23#issuecomment-1172932610
-rw-r--r-- | libraries/base/Data/Ord.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libraries/base/Data/Ord.hs b/libraries/base/Data/Ord.hs index cf95d69389..7742d714ab 100644 --- a/libraries/base/Data/Ord.hs +++ b/libraries/base/Data/Ord.hs @@ -132,6 +132,12 @@ instance (Show a) => Show (Down a) where -- | @since 4.6.0.0 instance Ord a => Ord (Down a) where compare (Down x) (Down y) = y `compare` x + Down x < Down y = y < x + Down x > Down y = y > x + Down x <= Down y = y <= x + Down x >= Down y = y >= x + min (Down x) (Down y) = Down (max y x) + max (Down x) (Down y) = Down (min y x) -- | Swaps @'minBound'@ and @'maxBound'@ of the underlying type. -- |