Skip to content

Commit

Permalink
[Chore] Fix a complation error due to new Universum
Browse files Browse the repository at this point in the history
Problem: retryAfterInfo doesn't compile because the type of
readMaybe got more polymorphic in Universum.

Solution: specify explicitly that the argument is Text.
N.B. In the previous version it was String (due to the old type of
readMaybe), but Text is generally preferable, so we're changing it.
  • Loading branch information
gromakovsky committed Sep 28, 2023
1 parent 2941a4d commit 693d6ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Xrefcheck/Verify.hs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,9 @@ checkExternalResource followed config@Config{..} link
other -> throwError $ ExternalResourceSomeError $ show other
where
retryAfterInfo :: Response a -> Maybe RetryAfter
retryAfterInfo = readMaybe . decodeUtf8 <=< L.lookup hRetryAfter . responseHeaders
retryAfterInfo =
readMaybe @_ @Text . decodeUtf8 <=<
L.lookup hRetryAfter . responseHeaders

checkFtp :: URI -> Bool -> ExceptT VerifyError IO ()
checkFtp uri secure = do
Expand Down

0 comments on commit 693d6ac

Please sign in to comment.