-
Notifications
You must be signed in to change notification settings - Fork 196
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
add return -> pure as default hint, active phase of proposal 0314 #1315
base: master
Are you sure you want to change the base?
add return -> pure as default hint, active phase of proposal 0314 #1315
Conversation
GHC => 9.2 have `-Wnoncanonical-monad-instances` `-Wnoncanonical-monoid-instances` enabled by by default. Upstream: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0314-warn-noncanonical-monad-instance-by-default.rst
This is a simple massive rename, so the next commit diff deduplication would be understandable.
Because hlint now advices return -> pure by default, return rules got converted into pure rules in the previous commit, this commit deletes rules fould to be duplicates.
Seems like cabal v2-run hlint -- --generate-summary has state preservation issues. Maybe it does not work without `cabal v2-run -- hlint --test` run beforehead. I changed `name` & `note` fields several times & was regenerating `hints.md` - but they were not updating with new information. Like now - I deleted a bunch of rules - it did not regenerated `hints.md`
If I would not reach my hands & mind to debug all what is going on before review - would say thanks to concise information/comments on project operation & what needs to be done to merge properly. |
Sorry for the delay in response, I've been a bit ill over the last bit of time. My understanding is the proposal mentioned warns about definitions in instances, whereas the patch here moves uses. Is that right? |
Yes. Correct understanding. The PR has two actions:
I think I should reopen the PR. I hit a Cabal bug during the initial stage, & wanted to do everything needed in 1 PR, with is probably too much of a leap/review in 1 PR, and now I have a better way to form the message. Seing there are 3 distinct phases to this. |
I think the intent is pretty clear, so happy to discuss this in terms of words, without adjusting the code. The proposal you link to doesn't mention suggesting people use pure instead of return. Is there community agreement that is the end state? |
Na, I won't think so. I prefer |
GHC 9.2 enabled by default
warn
on this.Upstream is: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0314-warn-noncanonical-monad-instance-by-default.rst
Enabling suggestion by default also allows at once to consolidate
return
&pure
rewriting rules.Consolidation diff is seen through 48696e2.
Seems because of that (or because rule was
warn
infuture
& nowhint
by default) - now chains of rules changed, so nowcabal v2-run -- hlint --test
not passes & idk what to do here.Also
cabal v2-run hlint -- --generate-summary
seems to use some old cache for generation ofhints.md
. Reported into #1316.