hirarchical modules

Iavor Diatchki diatchki@cse.ogi.edu
Wed, 28 May 2003 17:34:23 -0700


hello,

i was wondering how final is the design of the hirarchical module system 
for haskell?  i have been working on the monad library for the past week 
or so and this is my first experience with the hirarchical module system
in a real project. i must say that i find it very cumbersome.

here is why:  the whole monadic library is in the same directory, but 
since there is no way to use relative names, all the imports use the 
rather long fully qualified name.  things like:

import Control.Monad.X.ReaderT

are very common. and if the hirarchy gets deeper, names will get longer.
while the verbosilty is annoying there is a more serious problem. 
moving code around is very work intensive (and error prone).  for 
example, when i decide that what i have is stable enough i'd like to 
move it to the Control.Monad part of the library (i.e. get rid of the 
X).  that means that i have to go and change all the imports, and all 
the module names.

of course i have a haskell lexer at my disposition so i have a little 
program to do that for me, but that solution seems very unsatisfactory.

and there seems to be a rather obvious solution to this problem:
1. allow for imports relative to the location of the importing module
2. remove the requirement that the path to a module is hardcoded in the 
module name.

i am now hoping that someone will say: yes we already tought of that and 
it is indeed supported...
any thoughts?

bye
iavor