An optional shadowing warning (for the paranoid) seems reasonable.<div><br><br><div class="gmail_quote">On Tue, Jul 24, 2012 at 1:45 AM, Greg Weber <span dir="ltr"><<a href="mailto:greg@gregweber.info" target="_blank">greg@gregweber.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">sounds good. will there be a shadowing warning?<br>
<div><div class="h5"><br>
On Mon, Jul 23, 2012 at 5:28 PM, Lennart Augustsson<br>
<<a href="mailto:lennart@augustsson.net">lennart@augustsson.net</a>> wrote:<br>
> It's not often that one gets the chance to change something as<br>
> fundamental as the scoping rules of a language. Nevertheless, I would<br>
> like to propose a change to Haskell's scoping rules.<br>
><br>
> The change is quite simple. As it is, top level entities in a module<br>
> are in the same scope as all imported entities. I suggest that this<br>
> is changed to that the entities from the module are in an inner scope<br>
> and do not clash with imported identifiers.<br>
><br>
> Why? Consider the following snippet<br>
><br>
> module M where<br>
> import I<br>
> foo = True<br>
><br>
> Assume this compiles. Now change the module I so it exports something<br>
> called foo. After this change the module M no longer compiles since<br>
> (under the current scoping rules) the imported foo clashes with the<br>
> foo in M.<br>
><br>
> Pros: Module compilation becomes more robust under library changes.<br>
> Fewer imports with hiding are necessary.<br>
><br>
> Cons: There's the chance that you happen to define a module identifier<br>
> with the same name as something imported. This will typically lead to<br>
> a type error, but there is a remote chance it could have the same<br>
> type.<br>
><br>
> Implementation status: The Mu compiler has used the scoping rule for<br>
> several years now and it works very well in practice.<br>
><br>
> -- Lennart<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Haskell-prime mailing list<br>
> <a href="mailto:Haskell-prime@haskell.org">Haskell-prime@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/haskell-prime" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-prime</a><br>
><br>
</blockquote></div><br></div>