Fix GHC 9.8 warnings
All checks were successful
Build / audit (push) Successful in 7s
Build / test (push) Successful in 14m5s

This commit is contained in:
2024-08-11 13:00:01 +02:00
parent e0ca80db32
commit 42b9b671e1
2 changed files with 7 additions and 5 deletions

View File

@ -65,9 +65,11 @@ packageDownloads variableName = string (variableName <> "=\"")
<* string "\"\n"
hexDigit :: GenParser Word8
hexDigit =
let digitPair = count 2 hexDigitChar
in fst . head . readHex . fmap (toEnum . fromIntegral) <$> digitPair
hexDigit = count 2 hexDigitChar
>>= extractNumber . readHex . fmap (toEnum . fromIntegral)
where
extractNumber [(number, "")] = pure number
extractNumber _ = fail "Unable to convert a 2-digit hexadecimal number"
packageChecksum :: GenParser ByteString
packageChecksum = ByteString.pack <$> count 16 hexDigit