Namespace trouble
Jorge Adriano Aires
jadrian at mat.uc.pt
Wed May 19 23:58:42 EDT 2004
> On Wed, May 19, 2004 at 08:13:11PM +0100, Jorge Adriano Aires wrote:
> > > MyProgram/A.hs name: A import Aux.C
> > > MyProgram/Aux/B.hs name: Aux.B import C
> > > MyProgram/Aux/C.hs name: Aux.C
> >
> > But complains when importing C from B since its name is Aux.C.
> > What is the most elegant way to deal with such cases?
>
> The heirarchical module names are always "full paths" to the module.
> Aux.B still needs to refer to Aux.C.
>
> This is annoying if you want to move something into a different place,
> since it will refer to itself entirely using the full names.
>
> The description of the Heirarchical module standard suggests that they
> are open to ideas for improvement :-)
Yeap got it.
At first I did use "import Aux.C" but then I was trying to load B using ghci
from MyProgram/Aux. That didn't work because it expected C to be in an Aux
subdir. That confused me, but now it's obvious, I have to run ghci from the
"root" of my program.
Thanks!
J.A.
More information about the Glasgow-haskell-users
mailing list