Skip to content
Snippets Groups Projects
Commit 045e5f49 authored by Oleg Grenrus's avatar Oleg Grenrus Committed by Marge Bot
Browse files

Add Eq1 and Ord1 Fixed instances

parent d38397fa
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -28,7 +28,8 @@
`Eq`, `Ord`, `Show`, `Read`, `Eq1`, `Ord1`, `Show1`, `Read1`, `Generic`,
`Generic1`, and `Data` instances for `GHC.Tuple.Solo`.
* Add `Eq1`, `Read1` and `Show1` instance for `Complex`;
* Add `Eq1`, `Read1` and `Show1` instances for `Complex`;
add `Eq1` and `Ord1` instances for `Fixed;
add `Eq1/2`, `Ord1/2`, `Show1/2` and `Read1/2` instances for 3 and 4-tuples.
* Remove `Data.Semigroup.Option` and the accompanying `option` function.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment