Allow top-level shadowing for imported names?
Reid Barton
rwbarton at gmail.com
Tue Oct 4 15:46:55 UTC 2016
On Tue, Oct 4, 2016 at 7:12 AM, Yuras Shumovich <shumovichy at gmail.com> wrote:
> On Tue, 2016-10-04 at 04:48 -0400, Edward Kmett wrote:
>
>> It makes additions of names to libraries far less brittle. You can
>> add a
>> new export with a mere minor version bump, and many of the situations
>> where
>> that causes breakage can be fixed by this simple rule change.
>
> It would be true only if we also allow imports to shadow each other.
> Otherwise there will be a big chance for name clash yet.
Could you give a concrete example of what you are worried about? It's
already legal to have a clash between imported names as long as you
don't refer to the colliding name. For example if one of my imports A
exports a name `foo` which I don't use, and then another import B
starts to export the same name `foo`, there won't be any error as long
as I continue to not use `foo`.
Regards,
Reid Barton
More information about the ghc-devs
mailing list