module Finder (
initFinder, -- :: [PackageConfig] -> IO (),
findModule, -- :: ModuleName -> IO (Maybe (Module, ModuleLocation))
+ findPackageModule, -- :: ModuleName -> IO (Maybe (Module, ModuleLocation))
mkHomeModuleLocn, -- :: ModuleName -> String -> Maybe FilePath
-- -> IO ModuleLocation
emptyHomeDirCache, -- :: IO ()
= do { j <- maybeHomeModule name
; case j of
Just home_module -> return (Just home_module)
- Nothing -> maybePackageModule name
+ Nothing -> findPackageModule name
}
maybeHomeModule :: ModuleName -> IO (Maybe (Module, ModuleLocation))
))
-maybePackageModule :: ModuleName -> IO (Maybe (Module, ModuleLocation))
-maybePackageModule mod_name = do
+findPackageModule :: ModuleName -> IO (Maybe (Module, ModuleLocation))
+findPackageModule mod_name = do
pkgs <- getPackageInfo
-- hi-suffix for packages depends on the build tag.
found <- findOnPath (import_dirs p) file
case found of
Nothing -> loop ps
- Just path -> return (Just (mkFastString (name p), path ++ '/':file))
+ Just path -> return (Just (mkFastString (name p), path))
findOnPath :: [String] -> String -> IO (Maybe FilePath)
findOnPath path s = loop path