-
Notifications
You must be signed in to change notification settings - Fork 696
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
Too many import lists: let's make names unique and drop same-package import lists #2835
Comments
I also don't like the explicit imports everywhere style, found it irritating to work with, and am cool with this. But I am only an occasional cabal hacker, so I conformed to convention. This sort of thing should be decided by those who most frequently hack on the code since it matters most to their quality of life, so my opinion doesn't matter much here. That said, 👍 |
I find them useful for code navigation.
Can be controversial for data structure-like things, e.g. /cc @dcoutts |
@23Skidoo I personally use hasktags to do code navigation. This works really great for same-project since the tags file is then pretty comprehensive. If it's data structure like, I expect that it will be imported qualified and won't induce a conflict rename. |
In principle, I agree with disambiguating names wherever practical, but I don't want to see us in a situation like this. |
No, we should use namespaces and not ad-hoc prefixes. One way to make this less annoying is to just import qualified and then use Module.foo. |
OK, so I guess then an alternate proposal is to:
|
👍 I think that will already be a big improvement. |
Signed-off-by: Edward Z. Yang <[email protected]>
Instead of qualifying, in some cases I just added an extra 'hiding' pragma to squelch errors. Signed-off-by: Edward Z. Yang <[email protected]>
Instead of qualifying, in some cases I just added an extra 'hiding' pragma to squelch errors. Common conflicts (just grep for hiding): - Flag - Distribution.Simple.Compiler - Distribution.PackageDescription - Distribution.Simple.Setup - installedComponentId - Distribution.Package - Distribution.InstalledPackageInfo - doesFileExist - Distribution.PackageDescription.Check - instantiatedWith - I renamed the field in InstalledPackageInfo. But it's probably going away with Backpack bits; I migth just excise it soon. - absoluteInstallDirs and substPathTemplate - Distribution.Simple.InstallDirs - Distribution.Simple.LocalBuildInfo I fixed some shadowing errors by renaming local variables in some cases. Common shadowings (we should perhaps consider not using these as method/field names): - freeVars - components - noVersion - verbosity - get - description - name Some data structures were moved around (IPIConvert and ABIHash) to make it easier to handle import lists. Some functions in Utils could be turned into reexports of standard library functions. No explicit imports were removed from non-Cabal imports. These imports help maintain warning cleanliness across versions of GHC, so I don't recommend removing them. Signed-off-by: Edward Z. Yang <[email protected]>
Instead of qualifying, in some cases I just added an extra 'hiding' pragma to squelch errors. Common conflicts (just grep for hiding): - Flag - Distribution.Simple.Compiler - Distribution.PackageDescription - Distribution.Simple.Setup - installedComponentId - Distribution.Package - Distribution.InstalledPackageInfo - doesFileExist - Distribution.PackageDescription.Check - instantiatedWith - I renamed the field in InstalledPackageInfo. But it's probably going away with Backpack bits; I migth just excise it soon. - absoluteInstallDirs and substPathTemplate - Distribution.Simple.InstallDirs - Distribution.Simple.LocalBuildInfo I fixed some shadowing errors by renaming local variables in some cases. Common shadowings (we should perhaps consider not using these as method/field names): - freeVars - components - noVersion - verbosity - get - description - name Some data structures were moved around (IPIConvert and ABIHash) to make it easier to handle import lists. Some functions in Utils could be turned into reexports of standard library functions. No explicit imports were removed from non-Cabal imports. These imports help maintain warning cleanliness across versions of GHC, so I don't recommend removing them. Signed-off-by: Edward Z. Yang <[email protected]>
Instead of qualifying, in some cases I just added an extra 'hiding' pragma to squelch errors. Common conflicts (just grep for hiding): - Flag - Distribution.Simple.Compiler - Distribution.PackageDescription - Distribution.Simple.Setup - installedComponentId - Distribution.Package - Distribution.InstalledPackageInfo - doesFileExist - Distribution.PackageDescription.Check - instantiatedWith - I renamed the field in InstalledPackageInfo. But it's probably going away with Backpack bits; I migth just excise it soon. - absoluteInstallDirs and substPathTemplate - Distribution.Simple.InstallDirs - Distribution.Simple.LocalBuildInfo I fixed some shadowing errors by renaming local variables in some cases. Common shadowings (we should perhaps consider not using these as method/field names): - freeVars - components - noVersion - verbosity - get - description - name Some data structures were moved around (IPIConvert and ABIHash) to make it easier to handle import lists. Some functions in Utils could be turned into reexports of standard library functions. No explicit imports were removed from non-Cabal imports. These imports help maintain warning cleanliness across versions of GHC, so I don't recommend removing them. Signed-off-by: Edward Z. Yang <[email protected]>
We probably should also do this for cabal-install but I'll leave that for another time. |
Instead of qualifying, in some cases I just added an extra 'hiding' pragma to squelch errors. Common conflicts (just grep for hiding): - Flag - Distribution.Simple.Compiler - Distribution.PackageDescription - Distribution.Simple.Setup - installedComponentId - Distribution.Package - Distribution.InstalledPackageInfo - doesFileExist - Distribution.PackageDescription.Check - instantiatedWith - I renamed the field in InstalledPackageInfo. But it's probably going away with Backpack bits; I migth just excise it soon. - absoluteInstallDirs and substPathTemplate - Distribution.Simple.InstallDirs - Distribution.Simple.LocalBuildInfo I fixed some shadowing errors by renaming local variables in some cases. Common shadowings (we should perhaps consider not using these as method/field names): - freeVars - components - noVersion - verbosity - get - description - name Some data structures were moved around (IPIConvert and ABIHash) to make it easier to handle import lists. Some functions in Utils could be turned into reexports of standard library functions. No explicit imports were removed from non-Cabal imports. These imports help maintain warning cleanliness across versions of GHC, so I don't recommend removing them. Signed-off-by: Edward Z. Yang <[email protected]>
I've recently done several refactors on the Cabal code base (moving around some core fields in order to make things cleaner, etc) and I've noticed the single biggest annoying thing about doing this is fixing up the import lists. EVERY SINGLE TIME. It is driving me completely batty, and wasting so much of my time.
I want to kill it with fire. Specifically:
I want some people to agree that we should do this, and then I'll do it.
The text was updated successfully, but these errors were encountered: