diff --git a/plutus-ledger-api/changelog.d/20251127_160032_bezirg.md b/plutus-ledger-api/changelog.d/20251127_160032_bezirg.md new file mode 100644 index 00000000000..5caba6dfc8c --- /dev/null +++ b/plutus-ledger-api/changelog.d/20251127_160032_bezirg.md @@ -0,0 +1,3 @@ +### Added + +- Brought back Ratio.from/toGHC as deprecated. diff --git a/plutus-ledger-api/src/PlutusLedgerApi/Data/V3.hs b/plutus-ledger-api/src/PlutusLedgerApi/Data/V3.hs index 3fe0b1d7635..dea20abbbe6 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/Data/V3.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/Data/V3.hs @@ -234,6 +234,8 @@ module PlutusLedgerApi.Data.V3 , Ratio.denominator , Ratio.fromHaskellRatio , Ratio.toHaskellRatio + , Ratio.fromGHC + , Ratio.toGHC -- *** Association maps , V2.Map diff --git a/plutus-ledger-api/src/PlutusLedgerApi/V3.hs b/plutus-ledger-api/src/PlutusLedgerApi/V3.hs index 03ae1719187..bfcc8d8788a 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/V3.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/V3.hs @@ -127,6 +127,8 @@ module PlutusLedgerApi.V3 , Ratio.denominator , Ratio.fromHaskellRatio , Ratio.toHaskellRatio + , Ratio.fromGHC + , Ratio.toGHC -- *** Association maps , V2.Map diff --git a/plutus-tx/changelog.d/20251127_160027_bezirg.md b/plutus-tx/changelog.d/20251127_160027_bezirg.md new file mode 100644 index 00000000000..5caba6dfc8c --- /dev/null +++ b/plutus-tx/changelog.d/20251127_160027_bezirg.md @@ -0,0 +1,3 @@ +### Added + +- Brought back Ratio.from/toGHC as deprecated. diff --git a/plutus-tx/src/PlutusTx/Ratio.hs b/plutus-tx/src/PlutusTx/Ratio.hs index 8446c34b9e3..1e59bd61352 100644 --- a/plutus-tx/src/PlutusTx/Ratio.hs +++ b/plutus-tx/src/PlutusTx/Ratio.hs @@ -36,6 +36,8 @@ module PlutusTx.Ratio -- * Conversion from/to Haskell , fromHaskellRatio , toHaskellRatio + , fromGHC + , toGHC ) where import PlutusTx.Applicative qualified as P @@ -399,6 +401,13 @@ Note: Does not work on-chain. -} toHaskellRatio :: Rational -> HS.Rational toHaskellRatio (Rational n d) = n HS.% d +{-# DEPRECATED fromGHC "Use fromHaskellRatio instead" #-} +fromGHC :: HS.Rational -> Rational +fromGHC = fromHaskellRatio +{-# DEPRECATED toGHC "Use toHaskellRatio instead" #-} +toGHC :: Rational -> HS.Rational +toGHC = toHaskellRatio + {- HLINT ignore -} {- Note [Ratio]