-
Notifications
You must be signed in to change notification settings - Fork 9
Updating HLint to require using 'pure' instead of 'return' #720
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
Conversation
9f384c5 to
8be794c
Compare
Would |
wenkokke
left a comment
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 looks good to me, but it might be best to not merge this until just before we release version 1.0.0, so that there's fewer PRs impacted by this.
I think the proposal is to make return a top level function rather than a member of the Monad class. The reason to prioritise pure over return would be to not require a Monad constraint where it isn't needed. The proposal would take care of this by removing the Monad constraint from return. However, I do support using pure over return for consistency reasons. |
I'm of a similar mind.
Agreed, let's let this sit for a bit and revisit it just before or just after cutting the |
Let's do just before. |
My preference as well 👍. |
|
I'd probably just rip off the band-aid and it merge it 😛 |
dcoutts
left a comment
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.
Doesn't this misunderstand the Monad Of No Return proposal? It would not eliminate return, it would just make it a function that's not a method of the Monad class. So there's no need to switch from return to pure. The only compatibility thing would be to make sure any Monad instances we have (and I can't immediately think of any) don't define a custom return or >>.
So we must be clear w.r.t. these warnings. So there's nothing to do right? |
Yes, it's very much just (1) consistency, and (2) avoiding unnecessary monad constraints before that proposal lands. |
These are my thoughts as well when I added the HLint hints. |
8be794c to
7fb5241
Compare
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.
LGTM, but I wrote it. However, it took me upwards of 5 minutes to scroll past all the changes.
7fb5241 to
126ea82
Compare
Update the
.hlint.yamlto require usingpureinstead ofreturn. This change is intended to future-proof the code-base for the "Monad of No Return" proposal.The changes touch a lot of the code-base and if the churn is deemed too high for negligible benefits, we can delete this pull request.