-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix incomplete-uni-patterns
warnings
#1176
fix incomplete-uni-patterns
warnings
#1176
Conversation
the `flake.nix` build fails on these warnings: haskell#1154
exes/Main.hs
Outdated
checkHostURI defaults Nothing port = do | ||
let guessURI = confHostUri defaults | ||
Just authority = uriAuthority guessURI | ||
case uriAuthority guessURI of | ||
Nothing -> fail "No URI Authority" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new fail
is the only change in this PR which might have some effect, is this acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not simply disable the warning also in this case?
Is there evidence that this Just
match can actually fail?
NB: Ideally unexpected failing matches would come with source location (HasCallStack
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, reverted the changes and applied the pragma, like the other files
It was the easiest of the warnings to fix, and using fail
is consistent with the rest of the file IMO
There is no evidence the Just
match can actually fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My general strategy would be to turn off the incomplete-uni-patterns
warning, unless there is evidence that the match can actually fail.
(This is the conservative approach, trusting that the original code was correct.)
exes/Main.hs
Outdated
checkHostURI defaults Nothing port = do | ||
let guessURI = confHostUri defaults | ||
Just authority = uriAuthority guessURI | ||
case uriAuthority guessURI of | ||
Nothing -> fail "No URI Authority" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not simply disable the warning also in this case?
Is there evidence that this Just
match can actually fail?
NB: Ideally unexpected failing matches would come with source location (HasCallStack
).
incomplete-uni-patterns
warning, ignore some othersincomplete-uni-patterns
warning
incomplete-uni-patterns
warningincomplete-uni-patterns
warnings
Thanks @peterbecich ! |
the
flake.nix
build fails on these warnings: #1154No effective changes in this PR