Skip to content

Commit e100313

Browse files
authored
Adds back PlutusTx.Ratio.from/toGHC as deprecated. (#7466)
Co-authored-by: Nikolaos Bezirgiannis <[email protected]>
1 parent 4fcf1a3 commit e100313

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Added
2+
3+
- Brought back Ratio.from/toGHC as deprecated.

plutus-ledger-api/src/PlutusLedgerApi/Data/V3.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ module PlutusLedgerApi.Data.V3
234234
, Ratio.denominator
235235
, Ratio.fromHaskellRatio
236236
, Ratio.toHaskellRatio
237+
, Ratio.fromGHC
238+
, Ratio.toGHC
237239

238240
-- *** Association maps
239241
, V2.Map

plutus-ledger-api/src/PlutusLedgerApi/V3.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ module PlutusLedgerApi.V3
127127
, Ratio.denominator
128128
, Ratio.fromHaskellRatio
129129
, Ratio.toHaskellRatio
130+
, Ratio.fromGHC
131+
, Ratio.toGHC
130132

131133
-- *** Association maps
132134
, V2.Map
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Added
2+
3+
- Brought back Ratio.from/toGHC as deprecated.

plutus-tx/src/PlutusTx/Ratio.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ module PlutusTx.Ratio
3636
-- * Conversion from/to Haskell
3737
, fromHaskellRatio
3838
, toHaskellRatio
39+
, fromGHC
40+
, toGHC
3941
) where
4042

4143
import PlutusTx.Applicative qualified as P
@@ -399,6 +401,13 @@ Note: Does not work on-chain. -}
399401
toHaskellRatio :: Rational -> HS.Rational
400402
toHaskellRatio (Rational n d) = n HS.% d
401403

404+
{-# DEPRECATED fromGHC "Use fromHaskellRatio instead" #-}
405+
fromGHC :: HS.Rational -> Rational
406+
fromGHC = fromHaskellRatio
407+
{-# DEPRECATED toGHC "Use toHaskellRatio instead" #-}
408+
toGHC :: Rational -> HS.Rational
409+
toGHC = toHaskellRatio
410+
402411
{- HLINT ignore -}
403412

404413
{- Note [Ratio]

0 commit comments

Comments
 (0)