[commit: ghc] master: Revert "Respect the ordering of -package directives" (fac831f)

git at git.haskell.org git at git.haskell.org
Mon Dec 2 02:39:16 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/fac831fd1377bcce5ef7513ab35a83661877f14c/ghc

>---------------------------------------------------------------

commit fac831fd1377bcce5ef7513ab35a83661877f14c
Author: Patrick Palka <patrick at parcs.ath.cx>
Date:   Sun Dec 1 21:37:32 2013 -0500

    Revert "Respect the ordering of -package directives"
    
    This commit was accidentally pushed.
    
    This reverts commit 574ccfa231ca05d03d1da9d31e5bc81e74cc5e1e.


>---------------------------------------------------------------

fac831fd1377bcce5ef7513ab35a83661877f14c
 compiler/main/Packages.lhs |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index df5eddb..aefb536 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -59,7 +59,6 @@ import System.FilePath as FilePath
 import qualified System.FilePath.Posix as FilePath.Posix
 import Control.Monad
 import Data.Char (isSpace)
-import Data.Foldable (foldrM)
 import Data.List as List
 import Data.Map (Map)
 import qualified Data.Map as Map
@@ -981,7 +980,7 @@ getPreloadPackagesAnd dflags pkgids =
       preload = preloadPackages state
       pairs = zip pkgids (repeat Nothing)
   in do
-  all_pkgs <- throwErr dflags (foldrM (add_package pkg_map ipid_map) preload pairs)
+  all_pkgs <- throwErr dflags (foldM (add_package pkg_map ipid_map) preload pairs)
   return (map (getPackageDetails state) all_pkgs)
 
 -- Takes a list of packages, and returns the list with dependencies included,
@@ -1004,15 +1003,15 @@ closeDepsErr :: PackageConfigMap
              -> Map InstalledPackageId PackageId
              -> [(PackageId,Maybe PackageId)]
              -> MaybeErr MsgDoc [PackageId]
-closeDepsErr pkg_map ipid_map ps = foldrM (add_package pkg_map ipid_map) [] ps
+closeDepsErr pkg_map ipid_map ps = foldM (add_package pkg_map ipid_map) [] ps
 
 -- internal helper
 add_package :: PackageConfigMap
             -> Map InstalledPackageId PackageId
-            -> (PackageId,Maybe PackageId)
             -> [PackageId]
+            -> (PackageId,Maybe PackageId)
             -> MaybeErr MsgDoc [PackageId]
-add_package pkg_db ipid_map (p, mb_parent) ps
+add_package pkg_db ipid_map ps (p, mb_parent)
   | p `elem` ps = return ps     -- Check if we've already added this package
   | otherwise =
       case lookupPackage pkg_db p of
@@ -1020,12 +1019,12 @@ add_package pkg_db ipid_map (p, mb_parent) ps
                            missingDependencyMsg mb_parent)
         Just pkg -> do
            -- Add the package's dependents also
-           ps' <- foldrM add_package_ipid ps (depends pkg)
+           ps' <- foldM add_package_ipid ps (depends pkg)
            return (p : ps')
           where
-            add_package_ipid ipid@(InstalledPackageId str) ps
+            add_package_ipid ps ipid@(InstalledPackageId str)
               | Just pid <- Map.lookup ipid ipid_map
-              = add_package pkg_db ipid_map (pid, Just p) ps
+              = add_package pkg_db ipid_map ps (pid, Just p)
               | otherwise
               = Failed (missingPackageMsg str <> missingDependencyMsg mb_parent)
 



More information about the ghc-commits mailing list