Skip to content

Commit f6ba33c

Browse files
author
Jamie Bertram
committed
Fix args instance of Ratio
1 parent ecce120 commit f6ba33c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages.dhall

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ let additions =
173173
, "web-uievents"
174174
]
175175
, repo = "https://github.com/input-output-hk/purescript-web-common"
176-
, version = "v1.1.2"
176+
, version = "v1.1.3"
177177
}
178178
}
179179

src/PlutusTx/Ratio.purs

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ import Data.Argonaut.Encode.Aeson as E
1111
import Data.Profunctor.Strong ((&&&))
1212
import Data.Ratio as R
1313
import Data.Tuple (uncurry)
14-
import Text.Pretty (class Args, class Pretty, hsep, pretty, text)
14+
import Text.Pretty (class Args, class Pretty, hasArgs, hsep, pretty, text)
1515

1616
newtype Ratio a
1717
= Ratio (R.Ratio a)
1818

1919
instance showRatio :: (Show a) => Show (Ratio a) where
2020
show (Ratio x) = show x
2121

22-
instance argsRatio :: Args (Ratio a) where
23-
hasArgs _ = false
24-
hasNestedArgs _ = false
22+
instance argsRatio :: (Args a) => Args (Ratio a) where
23+
hasArgs _ = true
24+
hasNestedArgs (Ratio r) = hasArgs (R.numerator r) || hasArgs (R.denominator r)
2525

2626
instance prettyRatio :: Pretty a => Pretty (Ratio a) where
2727
pretty r = hsep [ pretty $ numerator r, text "%", pretty $ denominator r ]

0 commit comments

Comments
 (0)