summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2014-08-23 13:12:20 +0100
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-08-29 12:39:04 +0100
commit29f84d30e3283c3da50c7c37a544672db5eee2b7 (patch)
tree327494b9dcab9d7ddb43589e18622ef8f09e6963 /compiler
parent6930a88c307825d95f22ed9cb8ba3c894b600905 (diff)
downloadhaskell-29f84d30e3283c3da50c7c37a544672db5eee2b7.tar.gz
Fix long lines and trailing whitespace
in the previous patches in this series
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ghci/Linker.lhs10
-rw-r--r--compiler/main/Finder.lhs5
-rw-r--r--compiler/main/PackageConfig.hs2
-rw-r--r--compiler/main/Packages.lhs14
4 files changed, 20 insertions, 11 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index f581f9f59a..d4de513ba8 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -1117,7 +1117,8 @@ linkPackage dflags pkg
objs = [ obj | Object obj <- classifieds ]
archs = [ arch | Archive arch <- classifieds ]
- maybePutStr dflags ("Loading package " ++ sourcePackageIdString pkg ++ " ... ")
+ maybePutStr dflags
+ ("Loading package " ++ sourcePackageIdString pkg ++ " ... ")
-- See comments with partOfGHCi
when (packageName pkg `notElem` partOfGHCi) $ do
@@ -1132,8 +1133,11 @@ linkPackage dflags pkg
maybePutStr dflags "linking ... "
ok <- resolveObjs
- if succeeded ok then maybePutStrLn dflags "done."
- else throwGhcExceptionIO (InstallationError ("unable to load package `" ++ sourcePackageIdString pkg ++ "'"))
+ if succeeded ok
+ then maybePutStrLn dflags "done."
+ else let errmsg = "unable to load package `"
+ ++ sourcePackageIdString pkg ++ "'"
+ in throwGhcExceptionIO (InstallationError errmsg)
-- we have already searched the filesystem; the strings passed to load_dyn
-- can be passed directly to loadDLL. They are either fully-qualified
diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs
index 8b9a5e9547..65151d9b2d 100644
--- a/compiler/main/Finder.lhs
+++ b/compiler/main/Finder.lhs
@@ -616,13 +616,14 @@ cantFindErr cannot_find _ dflags mod_name find_result
hang (ptext (sLit "Locations searched:")) 2 $ vcat (map text files)
pkg_hidden pkgid =
- ptext (sLit "It is a member of the hidden package") <+> quotes (ppr pkgid)
+ ptext (sLit "It is a member of the hidden package")
+ <+> quotes (ppr pkgid)
--FIXME: we don't really want to show the package key here we should
-- show the source package id or installed package id if it's ambiguous
<> dot $$ cabal_pkg_hidden_hint pkgid
cabal_pkg_hidden_hint pkgid
| gopt Opt_BuildingCabalPackage dflags
- = let pkg = expectJust "cabal_pkg_hidden_hint" (lookupPackage dflags pkgid)
+ = let pkg = expectJust "pkg_hidden" (lookupPackage dflags pkgid)
in ptext (sLit "Perhaps you need to add") <+>
quotes (ppr (packageName pkg)) <+>
ptext (sLit "to the build-depends in your .cabal file.")
diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs
index 09ff0659b3..7cd2779bc4 100644
--- a/compiler/main/PackageConfig.hs
+++ b/compiler/main/PackageConfig.hs
@@ -68,7 +68,7 @@ instance BinaryStringRep PackageKey where
instance BinaryStringRep Module.ModuleName where
fromStringRep = Module.mkModuleName . BS.unpack
- toStringRep = BS.pack . Module.moduleNameString
+ toStringRep = BS.pack . Module.moduleNameString
instance Outputable InstalledPackageId where
ppr (InstalledPackageId str) = text str
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index cf9ab09f67..9640f72957 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -391,9 +391,10 @@ readPackageConfig dflags conf_file = do
isfile <- doesFileExist conf_file
if isfile
then throwGhcExceptionIO $ InstallationError $
- "ghc no longer supports single-file style package databases (" ++
- conf_file ++
- ") use 'ghc-pkg init' to create the database with the correct format."
+ "ghc no longer supports single-file style package " ++
+ "databases (" ++ conf_file ++
+ ") use 'ghc-pkg init' to create the database with " ++
+ "the correct format."
else throwGhcExceptionIO $ InstallationError $
"can't find a package database at " ++ conf_file
@@ -597,7 +598,8 @@ packageFlagErr dflags flag reasons
-- ToDo: this admonition seems a bit dodgy
text "(use -v for more information)")
ppr_reasons = vcat (map ppr_reason reasons)
- ppr_reason (p, reason) = pprReason (ppr (installedPackageId p) <+> text "is") reason
+ ppr_reason (p, reason) =
+ pprReason (ppr (installedPackageId p) <+> text "is") reason
pprFlag :: PackageFlag -> SDoc
pprFlag flag = case flag of
@@ -692,7 +694,9 @@ findWiredInPackages dflags pkgs = do
updateWiredInDependencies pkgs = map upd_pkg pkgs
where upd_pkg pkg
| installedPackageId pkg `elem` wired_in_ids
- = pkg { packageKey = stringToPackageKey (packageNameString pkg) }
+ = pkg {
+ packageKey = stringToPackageKey (packageNameString pkg)
+ }
| otherwise
= pkg