From f6ba33c8543e5c830592f86e94b3e89ca117e602 Mon Sep 17 00:00:00 2001 From: Jamie Bertram Date: Tue, 2 Nov 2021 09:18:54 -0400 Subject: [PATCH] Fix args instance of Ratio --- packages.dhall | 2 +- src/PlutusTx/Ratio.purs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages.dhall b/packages.dhall index c8d83d8..d6d7a19 100644 --- a/packages.dhall +++ b/packages.dhall @@ -173,7 +173,7 @@ let additions = , "web-uievents" ] , repo = "https://github.com/input-output-hk/purescript-web-common" - , version = "v1.1.2" + , version = "v1.1.3" } } diff --git a/src/PlutusTx/Ratio.purs b/src/PlutusTx/Ratio.purs index caffc2a..d2e350c 100644 --- a/src/PlutusTx/Ratio.purs +++ b/src/PlutusTx/Ratio.purs @@ -11,7 +11,7 @@ import Data.Argonaut.Encode.Aeson as E import Data.Profunctor.Strong ((&&&)) import Data.Ratio as R import Data.Tuple (uncurry) -import Text.Pretty (class Args, class Pretty, hsep, pretty, text) +import Text.Pretty (class Args, class Pretty, hasArgs, hsep, pretty, text) newtype Ratio a = Ratio (R.Ratio a) @@ -19,9 +19,9 @@ newtype Ratio a instance showRatio :: (Show a) => Show (Ratio a) where show (Ratio x) = show x -instance argsRatio :: Args (Ratio a) where - hasArgs _ = false - hasNestedArgs _ = false +instance argsRatio :: (Args a) => Args (Ratio a) where + hasArgs _ = true + hasNestedArgs (Ratio r) = hasArgs (R.numerator r) || hasArgs (R.denominator r) instance prettyRatio :: Pretty a => Pretty (Ratio a) where pretty r = hsep [ pretty $ numerator r, text "%", pretty $ denominator r ]