RE: Problem with hierarchical libraries in Hugs compared to ghc/nhc98
Better yet, drop the support for interpreting the '.' as anything but a hierarchial module namespace separator. That is, use this:
[ d ++ mod2dir nm ++ e | d <- dirs, e <- hugsSuffixes ]
The last release rightly supported both old and new style names. We're already committed to dropping the non-hierarchial libraries in future releases. Let's drop non-hierarchial names too.
I'm curious why you want to do that: in recent discussions on glasgow-haskell-users one or two people spoke up in favour of allowing the dotted version, and I was seriously considering adding it to GHC. I can't remember all the reasons off the top of my head though. Cheers, Simon
"Simon Marlow"
Better yet, drop the support for interpreting the '.' as anything but a hierarchial module namespace separator. That is, use this:
I'm curious why you want to do that: in recent discussions on glasgow-haskell-users one or two people spoke up in favour of allowing the dotted version, and I was seriously considering adding it to GHC. I can't remember all the reasons off the top of my head though.
I think you misunderstand Alastair's comment. The interpretation of '.' that he suggests getting rid of is that of relative directory pathnames, e.g. import "../../lib/Something.hs", which is currently permitted in Hugs, but should no longer be necessary now that we hierarchical libs. Regards, Malcolm
Alastair writes:
Better yet, drop the support for interpreting the '.' as anything but a hierarchial module namespace separator. That is, use this:
"Simon Marlow"
I'm curious why you want to do that: in recent discussions on glasgow-haskell-users one or two people spoke up in favour of allowing the dotted version, and I was seriously considering adding it to GHC. I can't remember all the reasons off the top of my head though.
Malcolm Wallace
I think you misunderstand Alastair's comment. The interpretation of '.' that he suggests getting rid of is that of relative directory pathnames, e.g. import "../../lib/Something.hs", which is currently permitted in Hugs, but should no longer be necessary now that we hierarchical libs.
Actually, Simon understood me perfectly. I don't see any value in the dotted version. There's two uses of dots in filenames: 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. 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. 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. -- Alastair ps Thing to watch for in applying proposed change: runhugs should continue to accept arbitrary filenames but they should always be interpreted as filenames relative to the current working directory. This is necessary so that the usual #! magic will work.
participants (3)
-
Alastair Reid -
Malcolm Wallace -
Simon Marlow