Skip to content

Commit b07ea85

Browse files
lehinsSoupstraw
authored andcommitted
Add a warning to the haddock of asNaturalHKD
1 parent 0eccc88 commit b07ea85

File tree

1 file changed

+2
-0
lines changed
  • eras/conway/impl/src/Cardano/Ledger/Conway

1 file changed

+2
-0
lines changed

eras/conway/impl/src/Cardano/Ledger/Conway/PParams.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,8 @@ conwayModifiedPPGroups
12411241
, ppGroup p31
12421242
]
12431243

1244+
-- | Care should be taken to not apply this function to signed values, otherwise it will result in
1245+
-- an `ArithmeticUnderflow` exception for negative numbers.
12441246
asNaturalHKD :: forall f i. (HKDFunctor f, Integral i) => HKD f i -> HKD f Natural
12451247
asNaturalHKD = hkdMap (Proxy @f) (fromIntegral @i @Natural)
12461248

0 commit comments

Comments
 (0)