Commit 7d4e5c1a authored by simonmar's avatar simonmar
Browse files

[project @ 2001-06-27 16:34:55 by simonmar]

Allow a module to be found on the package path only, by adding

  findPackageModule :: ModuleName -> IO (Maybe (Module,ModuleLocation))
parent e25c9d5e
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
module Finder ( module Finder (
initFinder, -- :: [PackageConfig] -> IO (), initFinder, -- :: [PackageConfig] -> IO (),
findModule, -- :: ModuleName -> IO (Maybe (Module, ModuleLocation)) findModule, -- :: ModuleName -> IO (Maybe (Module, ModuleLocation))
findPackageModule, -- :: ModuleName -> IO (Maybe (Module, ModuleLocation))
mkHomeModuleLocn, -- :: ModuleName -> String -> Maybe FilePath mkHomeModuleLocn, -- :: ModuleName -> String -> Maybe FilePath
-- -> IO ModuleLocation -- -> IO ModuleLocation
emptyHomeDirCache, -- :: IO () emptyHomeDirCache, -- :: IO ()
...@@ -52,7 +53,7 @@ findModule name ...@@ -52,7 +53,7 @@ findModule name
= do { j <- maybeHomeModule name = do { j <- maybeHomeModule name
; case j of ; case j of
Just home_module -> return (Just home_module) Just home_module -> return (Just home_module)
Nothing -> maybePackageModule name Nothing -> findPackageModule name
} }
maybeHomeModule :: ModuleName -> IO (Maybe (Module, ModuleLocation)) maybeHomeModule :: ModuleName -> IO (Maybe (Module, ModuleLocation))
...@@ -139,8 +140,8 @@ mkHomeModuleLocn mod_name basename maybe_source_fn = do ...@@ -139,8 +140,8 @@ mkHomeModuleLocn mod_name basename maybe_source_fn = do
)) ))
maybePackageModule :: ModuleName -> IO (Maybe (Module, ModuleLocation)) findPackageModule :: ModuleName -> IO (Maybe (Module, ModuleLocation))
maybePackageModule mod_name = do findPackageModule mod_name = do
pkgs <- getPackageInfo pkgs <- getPackageInfo
-- hi-suffix for packages depends on the build tag. -- hi-suffix for packages depends on the build tag.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment