)
where
- -- Dreadfully crude. We want a better way to distinguish
- -- "library-ish" modules.
- is_sys | head dir_path == '/' = LibMod
- | otherwise = UserMod
+ is_sys | isLibraryPath dir_path = LibMod
+ | otherwise = UserMod
+
+ -- Dreadfully crude way to tell whether a module is a "library"
+ -- module or not. The current story is simply that if path is
+ -- absolute we treat it as a library. Specifically:
+ -- /usr/lib/ghc/
+ -- C:/usr/lib/ghc
+ -- C:\user\lib
+ isLibraryPath ('/' : _ ) = True
+ isLibraryPath (_ : ':' : '/' : _) = True
+ isLibraryPath (_ : ':' : '\\' : _) = True
+ isLibraryPaty other = False
xiffus = reverse dotted_suffix
dotted_suffix = case suffix of
Use absolute path names only for directories containing slowly-changing
library modules.
+A path is considered ``absolute'' if it starts with ``@/@'', or
+``@A:/@'', or ``@A:\@'' (or ``@B:/@'', ``@B:\@'' etc).
+
Patrick Sansom had a workshop paper about how all this is done (though
the details have changed quite a bit). Ask
him (email: <htmlurl name="sansom@@dcs.gla.ac.uk"