diff options
author | Oleg Grenrus <oleg.grenrus@iki.fi> | 2021-04-04 17:22:11 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-26 23:54:34 -0400 |
commit | 045e5f49f81f98b8cfaeee08b572617a173f33da (patch) | |
tree | 572ff39370264776fc5aa4f0cac06b0745e8673b /libraries/base/Data/Functor/Classes.hs | |
parent | d38397fa26acb2588253ffd704e212dbf55b2bf4 (diff) | |
download | haskell-045e5f49f81f98b8cfaeee08b572617a173f33da.tar.gz |
Add Eq1 and Ord1 Fixed instances
Diffstat (limited to 'libraries/base/Data/Functor/Classes.hs')
-rw-r--r-- | libraries/base/Data/Functor/Classes.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libraries/base/Data/Functor/Classes.hs b/libraries/base/Data/Functor/Classes.hs index d672c340d7..82d78778d7 100644 --- a/libraries/base/Data/Functor/Classes.hs +++ b/libraries/base/Data/Functor/Classes.hs @@ -74,6 +74,7 @@ import Data.Complex (Complex((:+))) import GHC.Tuple (Solo (..)) import GHC.Read (expectP, list, paren) +import Data.Fixed (Fixed (..)) import Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec) import Text.Read (Read(..), parens, prec, step) @@ -870,6 +871,14 @@ instance Show1 Complex where where complexPrec = 6 +-- | @since 4.16.0.0 +instance Eq1 Fixed where + liftEq _eq (MkFixed x) (MkFixed y) = x == y + +-- | @since 4.16.0.0 +instance Ord1 Fixed where + liftCompare _cmp (MkFixed x) (MkFixed y) = compare x y + -- Building blocks -- | @'readsData' p d@ is a parser for datatypes where each alternative |