[project @ 2004-11-29 11:32:38 by simonmar]
authorsimonmar <unknown>
Mon, 29 Nov 2004 11:32:38 +0000 (11:32 +0000)
committersimonmar <unknown>
Mon, 29 Nov 2004 11:32:38 +0000 (11:32 +0000)
Look for package modules before home modules.  This fixes the build in
ghc/lib when bootstrapping with the HEAD.

ghc/compiler/main/Finder.lhs

index c255408..033c503 100644 (file)
@@ -102,16 +102,17 @@ findModule = cached findModule'
   
 findModule' :: DynFlags -> Module -> Bool -> IO FindResult
 findModule' dflags name explicit = do
-   j <- maybeHomeModule dflags name
-   case j of
-       NotFound home_files -> do
-           r <- findPackageModule' dflags name explicit
-           case r of
-               NotFound pkg_files 
-                       -> return (NotFound (home_files ++ pkg_files))
+    r <- findPackageModule' dflags name explicit
+    case r of
+       NotFound pkg_files -> do
+          j <- maybeHomeModule dflags name
+          case j of
+               NotFound home_files -> 
+                       return (NotFound (home_files ++ pkg_files))
                other_result
                        -> return other_result
-       other_result -> return other_result
+       other_result
+               -> return other_result
 
 cached fn dflags name explicit = do
   m <- lookupFinderCache name