> > Maybe there should be a standard place to put Haskell interfaces and
> > libraries/objects. As there can be many modules in a package and thus
> > many interfaces, and collisions between module names are harmless in
> > a case where both are not used in the same program, interfaces should
> > probably go to a separate directories for each package.
>  
> Yes, yes, yes!!

Me3 :-)

Can I propose a change to the -i / -I flags?  Currently, the -idir (or
-Idir) options add a directory to the search path for imports.  This
directory is either relative to the current dir, or absolute.  My
suggestion is that it could also be used for "relative to a standard
installation directory".  For instance, -Idata/edison would look first
in ./data/edison if it exists, then in $prefix/data/edison, where
$prefix has the value /usr/local/lib/ghc, or whatever.

I think this is a reasonably straightforward means to allow
hierarchical library organisation.  Plus, as of about two weeks ago,
nhc98 (in CVS) implements something similar to this feature.

However, -i / -I only covers imports, it doesn't cover linking.  Hence,
I also propose to extend the -L flag in the same way.  -Ldir usually
adds a relative or absolute directory to the link search path, so
the same extension would allow "-Ldata/edison -ledison" to search for
both ./data/edison/libedison.a and $prefix/data/edison/libedison.a.

So, to conclude, using a "standard" Haskell library would make the
compiler command lines look something like:

    ghc -c MyProg.hs -idata/edison
    ghc -o MyProg MyProg.o -Ldata/edison -ledison

which is not too painful, and matches C reasonably closely.

Regards,
    Malcolm

Reply via email to