<br><br><div><span class="gmail_quote">On 6/14/08, <b class="gmail_sendername">Henning Thielemann</b> &lt;<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><span class="e" id="q_11a883632923fe47_0"><br>
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 6/14/08, Henning Thielemann &lt;<a href="mailto:lemming@henning-thielemann.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lemming@henning-thielemann.de</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:<br>
<br>
&nbsp;On 6/14/08, Henning Thielemann &lt;<a href="mailto:lemming@henning-thielemann.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lemming@henning-thielemann.de</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The problem would be again that no one knows, where &quot;Window&quot; comes from.<br>
Better would be<br>
<br>
&nbsp;I really don&#39;t see how this is a big problem. Lots of languages do<br>
</blockquote>
hierarchical import (e.g. .Net languages) and I don&#39;t think I&#39;ve ever<br>
heard<br>
anyone complain about this particular aspect of it.<br>
<br>
</blockquote>
<br>
It&#39;s not a problem for you and thus you do not pay attention to these<br>
complaints, I suspect. Maybe the people who would complain about the<br>
importing style, simply don&#39;t use the mentioned languages.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The worst case scenario is that you need a little bit of tool support to<br>
help you sort it out. Plus, it&#39;s not like you can&#39;t just qualify the import<br>
to make it easier to see where it comes from if you really think it&#39;s a<br>
problem:<br>
<br>
</blockquote>
<br>
Cf.<br>
&nbsp;<a href="http://www.haskell.org/haskellwiki/Import_modules_properly" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.haskell.org/haskellwiki/Import_modules_properly</a><br>
<br>
&nbsp;Haskell can re-export modules, which makes tracing identifiers more<br>
difficult. I want to be able to read modules without using a tool.<br>
<br>
</blockquote>
<br>
I&#39;m not sure I understand you point. You&#39;re so opposed to the *option* of<br>
allowing hierarchical exports (even though you can still import it qualified<br>
if you personally like having to specify at each callsite exactly where some<br>
identifier is coming from),<br>
</blockquote>
<br></span></div>
I was concerned with the _import_ part of your proposal. (I haven&#39;t thought about the export part so far.)<span class="q"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
that you&#39;d rather any library making use of a module hierarchy is forced to either make the user add dozens of boilerplate import statements (with &quot;qualified&quot; and &quot;as&quot;) or the more common strategy of prefixing each function call with the module name (buttonNew)? To me a module system that requires the latter in practice is horribly broken, and I&#39;m suggesting a low-impact way of fixing it. It may not be the best system available, but it&#39;s a tiny extension of the current.<br>

<br>
I really don&#39;t see why adding this option hurts you, when it clearly helps<br>
enable doing what this thread advocates (use qualified modules to<br>
distinguish between functions of the same name, rather than adding a bunch<br>
of prefixes/suffixes to the functions).<br>
</blockquote>
<br></span>
Button.new is my favorite, because with current import variants I can easily lookup, what Button and Button.new refer to. I understand your proposal in that way that<br>
<br>
import Graphics.UI.Gtk<br>
<br>
brings module qualifications Window and Button into scope although they are not explicitly mentioned. Thus I could no longer find out easily what Butten.new means.<br>
</blockquote></div><p>I don&#39;t see why this is so bad when it&#39;s exactly what we have for other identifiers? E.g. if you import Control.Monad you get mapM, but you can&#39;t really say for sure where this identifier comes from, which is no better than not knowing where &quot;Button.new&quot; comes from. In both cases you have the option to qualify the module import so you have to say &quot;Monad.mapM&quot; or &quot;GTK.Button.new&quot; which makes it more apparent.</p>
<p>I suppose you would make the &quot;hiding&quot; clause and the &quot;import list&quot; thing work with modules too for consistency, so if you really wanted to you could list the modules/identifiers that you bring in.</p>
<p>Are you saying that you prefer the situation where to use GTK the user would have to explicitly import every single sub-module in the hierarchy (&quot;import qualified Graphics.UI.GTK.X as X&quot; where X = {Button,Window, ... etc})? I don&#39;t think that&#39;s very nice at all, and I certainly don&#39;t like having to add the module name to the functions... I think lots of libraries are like that, and we need some mechanism of importing lots of related modules together so that they come in qualified, without forcing the user to write a gazillion lines of boilerplate import statements.. </p>
<p>I think that if GTK did use this system (rather than append the module name to the function and export them &quot;flatly&quot;) a lot of people would resort to ugly hacks like putting the import statements in a file somewhere and using the C preprocessor to include it, yuck! (OTOH this may be just what&#39;s required to convince everyone that we need to improve the module system)...<br clear="all">
</p><br>-- <br>Sebastian Sylvan<br>+44(0)7857-300802<br>UIN: 44640862