<br><br><div class="gmail_quote">On Thu, Jun 5, 2008 at 4:19 PM, Johan Tibell &lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
* Why is this practice common in Haskell<br>
<br>
Here are some guesses:<br>
<br>
1. It&#39;s common in papers. However, papers and libraries are quite<br>
different. The former usually build up a small vocabulary and having<br>
short names is a big win. Papers rarely make use of the module system<br>
at all. The latter are included as pieces of large programs and their<br>
names need to be adjusted accordingly.<br>
<br>
2. It&#39;s the default. You have to add &quot;qualified&quot; to all your imports<br>
to make them qualified. In most language imports are qualified by<br>
default. I think the latter would have been a better choice but we<br>
have to live with the current design so bite the bullet and add those<br>
qualified keywords to your imports.<br>
<br>
3. Lack of common interfaces. An example would be two different set<br>
implementations that essentially have the same interface but since<br>
there is no explicitly shared interface, defined using a type class,<br>
you sometimes end up with different names. The lack of type families<br>
might explain why e.g. collection classes don&#39;t share interfaces.<br>
<br>
4. Haskell is a very expressive language. You can often write a whole<br>
function definition on one line! Adding those module qualifications<br>
makes your code slightly longer and it might just break your beautiful<br>
one liner into two lines.<br>
</blockquote><div><br>Another BIG reason: It&#39;s impossible to export a whole hierarchy qualified. I.e it would be neat if the user could write:<br><br>import Graphics.UI.Gtk<br><br>And then have Gtk re-export sub-modules qualified, so you could write &quot;Button.new&quot;, &quot;Window.new&quot; etc. etc. As it stands you have two options: prefix all the &quot;new&quot; functions with the kind of widget they create (buttonNew, windowNew), or force the user to add a gazillion qualified imports.<br>
<br>Ideally you would be able to add &quot;qualified&quot; to the module export statement, and have it automatically bring in that module qualified (it should also support an &quot;as&quot; so you&#39;d write &quot;qualified module Graphics.UI.Gtk.Button as Button&quot; in the export list to get the above behaviour.)<br>
</div></div><br clear="all"><br>-- <br>Sebastian Sylvan<br>+44(0)7857-300802<br>UIN: 44640862