Fix a few minor issues spotted in code review
authorDuncan Coutts <duncan@well-typed.com>
Thu, 28 Aug 2014 04:24:04 +0000 (05:24 +0100)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Fri, 29 Aug 2014 14:03:33 +0000 (15:03 +0100)
compiler/main/PackageConfig.hs
compiler/main/Packages.lhs
utils/ghc-pkg/Main.hs

index 038291d..3f2bf16 100644 (file)
@@ -107,7 +107,7 @@ pprPackageConfig InstalledPackageInfo {..} =
       field "trusted"              (ppr trusted),
       field "import-dirs"          (fsep (map text importDirs)),
       field "library-dirs"         (fsep (map text libraryDirs)),
-      field "hs-libraries"         (fsep (map text hsLibraries)), 
+      field "hs-libraries"         (fsep (map text hsLibraries)),
       field "extra-libraries"      (fsep (map text extraLibraries)),
       field "extra-ghci-libraries" (fsep (map text extraGHCiLibraries)),
       field "include-dirs"         (fsep (map text includeDirs)),
index 37ddd84..01c75c0 100644 (file)
@@ -1363,7 +1363,8 @@ add_package pkg_db ipid_map ps (p, mb_parent)
               | Just pid <- Map.lookup ipid ipid_map
               = add_package pkg_db ipid_map ps (pid, Just p)
               | otherwise
-              = Failed (missingPackageMsg ipid <> missingDependencyMsg mb_parent)
+              = Failed (missingPackageMsg ipid
+                          <> missingDependencyMsg mb_parent)
 
 missingPackageErr :: Outputable pkgid => DynFlags -> pkgid -> IO a
 missingPackageErr dflags p
index fdb255a..ac958da 100644 (file)
@@ -57,7 +57,6 @@ import Control.Concurrent
 
 import qualified Data.ByteString.Char8 as BS
 import Data.Binary as Bin
---import qualified Data.Binary.Get as Bin
 
 #if defined(mingw32_HOST_OS)
 -- mingw32 needs these for getExecDir
@@ -2141,4 +2140,4 @@ instance Binary PackageKey where
            case n of
             0 -> do a <- get; b <- get; c <- get; return (PackageKey a b c)
             1 -> do a <- get; return (OldPackageKey a)
-            _ -> error ("Binary PackageKey: bad branch " ++ show n)
+            _ -> fail ("Binary PackageKey: bad branch " ++ show n)