Skip to content
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

HLint recommends to change FunctionalDependencies to MultiParamTypeClasses #768

Closed
phadej opened this issue Sep 19, 2019 · 5 comments
Closed

Comments

@phadej
Copy link
Contributor

phadej commented Sep 19, 2019

... which is technically correct, but I'd prefer to almost always use FunctionalDependencies
(and in fact get a hint if there's a MultiParamTypeClass defined without any FunDep).

Is there a way to configure unused language pragma hints per pragma? Specifically in my case, "if there are multiparamtypeclass instances, fundep is fine"/

@ndmitchell
Copy link
Owner

Why do you prefer to use a more powerful extension that you don't actually use? Generally speaking, preferring the most restrictive extension that meets your needs makes sense.

@phadej
Copy link
Contributor Author

phadej commented Sep 19, 2019

In short, I'd need a proper IDE, so when I move code around I don't need to weakenFunctionalDependencies to MultiParamTypeClasses manually. In cases where HLint suggest to remove an extension like DeriveFunctor e.g., it's simpler to do.

EDIT: if a package already have to use FunctionalDependencies, then having MultiParamTypeClasses in few modules introduces unnecessary (IMHO) non-uniformity.

@ndmitchell
Copy link
Owner

You're in luck! https://github.com/digital-asset/ghcide is now out. I know @shayne-fletcher-da has been working on an HLint plugin that fits together with it. Not sure how far away that is.

I think if there is a feature to add to HLint, it would be ignoring unused warnings extension warnings in certain cases. Currently they all have the same name, so you have to ignore all of them, or none of them, not on an extension by extension basis.

@ghost
Copy link

ghost commented Sep 20, 2019

Thanks for the ping @ndmitchell, @phadej. You can track progress on integration of an HLint pluging for ghcide here haskell/ghcide#104.

@phadej
Copy link
Contributor Author

phadej commented Sep 20, 2019

a proper IDE was slightly sarcastic comment, though I do value your work on ghcide.

I guess this is not going to be even configurable, I'm closing this issue.

@phadej phadej closed this as completed Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants