Problem with hierarchical libraries in Hugs compared to ghc/nhc98

Simon Marlow
Fri, 14 Mar 2003 14:04:08 -0000

> Actually, Simon understood me perfectly.  I don't see any value in the
> dotted version.  There's two uses of dots in filenames:=20
> 1) As just another character - like including a ', @, $ or whatever in
>    a filename.
>    I'd disallow all of these since they're not legal Haskell module
>    names so they don't fit into the hierarchical naming scheme.
> 2) Part of either . (current directory) or .. (parent directory).
>    I'd disallow these because they aren't needed now we have
>    hierarchical libraries.  =20

I don't quite follow you.  The issue as I see it is whether a module
A.B.C can be placed in a file A.B.C.hs, or whether it has to be named
A/B/C.hs (substitute / for the local directory separator).  IIRC some
people wanted to be able to do this - I suppose it might be useful to
avoid deep/sparse directory structures.

>    Note that the ghc-users discussion would have a quite different
>    semantics from what Hugs has.  Hugs semantics is to simultaneously
>    try to interpret filenames two ways: first relative to the current
>    directory, and second relative to the search path.

How is that different from adding the current directory to the search
path?  (which is what GHC does by default).

>    The proposed
>    semantics is to either treat it as relative to the current
>    directory if it contains a leading dot or to treat it as relative
>    to the search path otherwise.

by "current directory" you mean "directory in which the current module
resides?"  (i.e. not the same as the meaning of ".").