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

Identifier hiding/showing and Qualified Modules #531

Open
TimWhiting opened this issue May 22, 2024 · 0 comments
Open

Identifier hiding/showing and Qualified Modules #531

TimWhiting opened this issue May 22, 2024 · 0 comments

Comments

@TimWhiting
Copy link
Collaborator

It would be nice to be able to hide or show certain parts of modules or require them to be prefixed by module name (without also requiring them to be prefixed by local qualifiers).

Especially when considering the implicit and overloading resolution.

It also might be useful for this to be a local mechanism and not just global at the import statement.

I'm not sure the best design, or whether to just allow hide or just allow show, or just requiring module names.

The problem with just requiring module names, is that it might cause issues with implicit resolution, though I guess that might be the point of hiding that particular module - but what if you want one definition in the imported module to participate in implicit resolution, but not another.

I think importing as qualified though would be a useful feature in general.

Additionally I think we should at the very least support something more general than at a specific identifier level like:

import qualified something =  s, showing implicits
// and
import something, hiding implicits

Which would allow it to resolve implicits, while still requiring using the qualified identifier elsewhere
or hide the module's definitions from participating in implicit resolution.

The default of qualified imports actually might be to resolve implicits.

At a local level, we could add a using expression? Which would then for that section of code reimport the required module but under different scope.

using modulename = mod1 hiding implicits
... 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant