Fix GHC 9.8 warnings
This commit is contained in:
parent
e0ca80db32
commit
42b9b671e1
@ -65,9 +65,11 @@ packageDownloads variableName = string (variableName <> "=\"")
|
|||||||
<* string "\"\n"
|
<* string "\"\n"
|
||||||
|
|
||||||
hexDigit :: GenParser Word8
|
hexDigit :: GenParser Word8
|
||||||
hexDigit =
|
hexDigit = count 2 hexDigitChar
|
||||||
let digitPair = count 2 hexDigitChar
|
>>= extractNumber . readHex . fmap (toEnum . fromIntegral)
|
||||||
in fst . head . readHex . fmap (toEnum . fromIntegral) <$> digitPair
|
where
|
||||||
|
extractNumber [(number, "")] = pure number
|
||||||
|
extractNumber _ = fail "Unable to convert a 2-digit hexadecimal number"
|
||||||
|
|
||||||
packageChecksum :: GenParser ByteString
|
packageChecksum :: GenParser ByteString
|
||||||
packageChecksum = ByteString.pack <$> count 16 hexDigit
|
packageChecksum = ByteString.pack <$> count 16 hexDigit
|
||||||
|
@ -65,8 +65,8 @@ spec = do
|
|||||||
in parseInfoFile' infoDownload1 `parseSatisfies` condition
|
in parseInfoFile' infoDownload1 `parseSatisfies` condition
|
||||||
|
|
||||||
it "translates checksum characters into the binary format" $
|
it "translates checksum characters into the binary format" $
|
||||||
let expected = "0102030405060708090a0b0c0d0e0f10"
|
let expected = ["0102030405060708090a0b0c0d0e0f10"]
|
||||||
condition = (== expected) . show . head . checksums
|
condition = (== expected) . fmap show . checksums
|
||||||
in parseInfoFile' infoDownload1 `parseSatisfies` condition
|
in parseInfoFile' infoDownload1 `parseSatisfies` condition
|
||||||
|
|
||||||
it "accepts an empty downloads list" $
|
it "accepts an empty downloads list" $
|
||||||
|
Loading…
Reference in New Issue
Block a user