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">&lt;<a href="mailto:greg@gregweber.info" target="_blank">greg@gregweber.info</a>&gt;</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>
&lt;<a href="mailto:lennart@augustsson.net">lennart@augustsson.net</a>&gt; wrote:<br>
&gt; It&#39;s not often that one gets the chance to change something as<br>
&gt; fundamental as the scoping rules of a language.  Nevertheless, I would<br>
&gt; like to propose a change to Haskell&#39;s scoping rules.<br>
&gt;<br>
&gt; The change is quite simple.  As it is, top level entities in a module<br>
&gt; are in the same scope as all imported entities.  I suggest that this<br>
&gt; is changed to that the entities from the module are in an inner scope<br>
&gt; and do not clash with imported identifiers.<br>
&gt;<br>
&gt; Why?  Consider the following snippet<br>
&gt;<br>
&gt;     module M where<br>
&gt;     import I<br>
&gt;     foo = True<br>
&gt;<br>
&gt; Assume this compiles.  Now change the module I so it exports something<br>
&gt; called foo.  After this change the module M no longer compiles since<br>
&gt; (under the current scoping rules) the imported foo clashes with the<br>
&gt; foo in M.<br>
&gt;<br>
&gt; Pros: Module compilation becomes more robust under library changes.<br>
&gt; Fewer imports with hiding are necessary.<br>
&gt;<br>
&gt; Cons: There&#39;s the chance that you happen to define a module identifier<br>
&gt; with the same name as something imported.  This will typically lead to<br>
&gt; a type error, but there is a remote chance it could have the same<br>
&gt; type.<br>
&gt;<br>
&gt; Implementation status: The Mu compiler has used the scoping rule for<br>
&gt; several years now and it works very well in practice.<br>
&gt;<br>
&gt;   -- Lennart<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Haskell-prime mailing list<br>
&gt; <a href="mailto:Haskell-prime@haskell.org">Haskell-prime@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-prime" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-prime</a><br>
&gt;<br>
</blockquote></div><br></div>