@@ -63,7 +63,6 @@ import GHC.Generics
6363import PlutusTx.Blueprint.Class (HasBlueprintSchema (.. ))
6464import PlutusTx.Blueprint.Definition (HasBlueprintDefinition (.. ), HasSchemaDefinition )
6565import Prettyprinter (Pretty (.. ), (<+>) )
66- import Prelude (Ord (.. ), Show , (*) )
6766import Prelude qualified as Haskell
6867
6968{-| Represents an arbitrary-precision ratio.
@@ -73,7 +72,7 @@ The following two invariants are maintained:
73721. The denominator is greater than zero.
74732. The numerator and denominator are coprime. -}
7574data Rational = Rational Integer Integer
76- deriving stock (Haskell.Eq , Show , Generic )
75+ deriving stock (Haskell.Eq , Haskell. Show , Generic )
7776
7877makeLift ''Rational
7978
@@ -96,12 +95,12 @@ instance P.Ord Rational where
9695 {-# INLINEABLE (>) #-}
9796 Rational n d > Rational n' d' = (n P. * d') P. > (n' P. * d)
9897
99- instance Ord Rational where
100- compare (Rational n d) (Rational n' d') = compare (n * d') (n' * d)
101- Rational n d <= Rational n' d' = (n * d') <= (n' * d)
102- Rational n d >= Rational n' d' = (n * d') >= (n' * d)
103- Rational n d < Rational n' d' = (n * d') < (n' * d)
104- Rational n d > Rational n' d' = (n * d') > (n' * d)
98+ instance Haskell. Ord Rational where
99+ compare (Rational n d) (Rational n' d') = Haskell. compare (n Haskell. * d') (n' Haskell. * d)
100+ Rational n d <= Rational n' d' = (n Haskell. * d') Haskell. <= (n' Haskell. * d)
101+ Rational n d >= Rational n' d' = (n Haskell. * d') Haskell. >= (n' Haskell. * d)
102+ Rational n d < Rational n' d' = (n Haskell. * d') Haskell. < (n' Haskell. * d)
103+ Rational n d > Rational n' d' = (n Haskell. * d') Haskell. > (n' Haskell. * d)
105104
106105instance P. AdditiveSemigroup Rational where
107106 {-# INLINEABLE (+) #-}
@@ -367,11 +366,11 @@ instance Enum Rational where
367366 {-# INLINEABLE enumFromTo #-}
368367 enumFromTo x lim
369368 -- See why adding half is needed in the Haskell report: https://www.haskell.org/onlinereport/haskell2010/haskellch6.html
370- | x > lim P. + Rational 1 2 = []
369+ | x P. > lim P. + Rational 1 2 = []
371370 | P. True = x : enumFromTo (succ x) lim
372371 {-# INLINEABLE enumFromThenTo #-}
373372 enumFromThenTo x y lim =
374- if delta >= P. zero
373+ if delta P. >= P. zero
375374 then up_list x
376375 else dn_list x
377376 where
@@ -380,12 +379,12 @@ instance Enum Rational where
380379 mid = numerator delta `unsafeRatio` (denominator delta P. * 2 )
381380 up_list x1 =
382381 -- See why adding mid is needed in the Haskell report: https://www.haskell.org/onlinereport/haskell2010/haskellch6.html
383- if x1 > lim P. + mid
382+ if x1 P. > lim P. + mid
384383 then []
385384 else x1 : up_list (x1 P. + delta)
386385 dn_list x1 =
387386 -- See why adding mid is needed in the Haskell report: https://www.haskell.org/onlinereport/haskell2010/haskellch6.html
388- if x1 < lim P. + mid
387+ if x1 P. < lim P. + mid
389388 then []
390389 else x1 : dn_list (x1 P. + delta)
391390
0 commit comments