<br>Do you know any document pointing out the rationale behind this decision about modules taken by the Haskell designers?<br><br>Thanks.<br>-Damodar<br><br><div class="gmail_quote">On Sat, Sep 15, 2012 at 9:30 PM, Karl Voelker <span dir="ltr">&lt;<a href="mailto:ktvoelker@gmail.com" target="_blank">ktvoelker@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Sep 14, 2012 at 6:23 PM, Christopher Howard<br>
&lt;<a href="mailto:christopher.howard@frigidcode.com">christopher.howard@frigidcode.com</a>&gt; wrote:<br>
&gt;<br>
&gt; import qualified Plant as P<br>
&gt;<br>
&gt; P.Fruit.Raspberry.jam<br>
<br>
</div>Short answer: P.Fruit.Raspberry.jam would work if you said:<br>
<br>
import qualified Plant.Fruit.Raspberry as P.Fruit.Raspberry<br>
<br>
Long answer:<br>
<br>
You can&#39;t have exactly what you want because the Haskell module<br>
namespace isn&#39;t exactly heirarchical. Here&#39;s an excerpt from the<br>
Haskell 98 report [1]:<br>
<br>
&quot;The name-space for modules themselves is flat, with each module being<br>
associated with a unique module name (which are Haskell identifiers<br>
beginning with a capital letter; i.e. modid).&quot;<br>
<br>
Notice that this doesn&#39;t allow for dots in module names. A<br>
commonly-provided language extension allowed dots in module names, and<br>
compilers took these dots as a signal to look for a module&#39;s source at<br>
a particular place in the directory tree, but the semantics of the<br>
language didn&#39;t have a heirarchy of modules.<br>
<br>
Things haven&#39;t changed much in Haskell 2010, other than the existing<br>
use of dots being formalized [2]:<br>
<br>
&quot;Module names can be thought of as being arranged in a hierarchy in<br>
which appending a new component creates a child of the original module<br>
name. For example, the module <a href="http://Control.Monad.ST" target="_blank">Control.Monad.ST</a> is a child of the<br>
Control.Monad sub-hierarchy. This is purely a convention, however, and<br>
not part of the language definition; in this report a modid is treated<br>
as a single identifier occupying a flat namespace.&quot;<br>
<br>
In your code snippet, P.Fruit.Raspberry doesn&#39;t work because although<br>
P refers to the same module as Plant, there isn&#39;t anything &quot;inside&quot; P<br>
(or Plant) called Fruit.Raspberry.<br>
<br>
-Karl<br>
<br>
[1] <a href="http://www.haskell.org/onlinereport/modules.html" target="_blank">http://www.haskell.org/onlinereport/modules.html</a><br>
[2] <a href="http://www.haskell.org/onlinereport/haskell2010/haskellch5.html#x11-980005" target="_blank">http://www.haskell.org/onlinereport/haskell2010/haskellch5.html#x11-980005</a><br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br><br clear="all"><br><br>