-
Notifications
You must be signed in to change notification settings - Fork 198
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
Warning: use Just: fromMaybe False -> (Just True ==) #970
Comments
For the replacement HLint suggested, which is merely replacing As it happens, HLint doesn't suggest anything for |
I've added detection of redundant sections, so closing this as expected (if not necessarily ideal) behaviour. |
@ndmitchell Really appreciate the work on However this particular recommendation always makes me scratch my head. Here's a sample on the postgrest codebase: https://github.com/PostgREST/postgrest/blob/24064f86265b54701fa3c508099e211fb52b0887/src/PostgREST/Config.hs#L167 I find the fromMaybe much more straightforward to understand, also to write. Why is the |
Usually this is part of a refactoring that takes you from |
@ndmitchell Thanks a lot for the prompt reply and fix!
I totally agree.
Yes! Thank you! |
And totally agreed about the negation semantics. That's why I find |
Can you give an example of this? |
@codygman I think the classic is I have an optional value,
Replace
That seems rather confusing. I'm not filling in a default, I'm matching on a value. They happen to be equivalent, but the purpose is obscured. Conversely, there are places with |
When I run hlint on
The suggestion is:
Are the parens necessary?
The text was updated successfully, but these errors were encountered: