Skip to content

Commit e4747e9

Browse files
committed
fix incomplete-uni-patterns warning, ignore some others
the `flake.nix` build fails on these warnings: haskell#1154
1 parent 7168298 commit e4747e9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

exes/Main.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,19 @@ runAction opts = do
358358
-> return n
359359
_ -> fail $ "bad port number " ++ show str
360360

361+
checkHostURI :: ServerConfig -> Maybe String -> Int -> IO URI
361362
checkHostURI defaults Nothing port = do
362363
let guessURI = confHostUri defaults
363-
Just authority = uriAuthority guessURI
364+
case uriAuthority guessURI of
365+
Nothing -> fail "No URI Authority"
366+
Just authority -> let
364367
portStr | port == 80 = ""
365368
| otherwise = ':' : show port
366369
guessURI' = guessURI { uriAuthority = Just authority { uriPort = portStr } }
367-
lognotice verbosity $ "Guessing public URI as " ++ show guessURI'
370+
in do
371+
lognotice verbosity $ "Guessing public URI as " ++ show guessURI'
368372
++ "\n(you can override with the --base-uri= flag)"
369-
return guessURI'
373+
return guessURI'
370374

371375
checkHostURI _ (Just str) _ = case parseAbsoluteURI str of
372376
Nothing -> fail $ "Cannot parse as a URI: " ++ str ++ "\n"

0 commit comments

Comments
 (0)