summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/CmdLineParser.hs3
-rw-r--r--compiler/main/DriverPipeline.hs6
-rw-r--r--compiler/main/ErrUtils.lhs4
-rw-r--r--compiler/main/Finder.lhs14
-rw-r--r--compiler/main/HeaderInfo.hs2
-rw-r--r--compiler/main/Packages.lhs6
6 files changed, 20 insertions, 15 deletions
diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs
index 5ee7086cbc..7d7bbfe95e 100644
--- a/compiler/main/CmdLineParser.hs
+++ b/compiler/main/CmdLineParser.hs
@@ -33,8 +33,9 @@ import Data.Function
import Data.List
import Control.Monad (liftM, ap)
+#if __GLASGOW_HASKELL__ < 709
import Control.Applicative (Applicative(..))
-
+#endif
--------------------------------------------------------
-- The Flag and OptKind types
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 5a18e6e7bf..0e17793e07 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1593,7 +1593,7 @@ mkExtraObjToLinkIntoBinary dflags = do
where
main
- | gopt Opt_NoHsMain dflags = empty
+ | gopt Opt_NoHsMain dflags = Outputable.empty
| otherwise = vcat [
ptext (sLit "#include \"Rts.h\""),
ptext (sLit "extern StgClosure ZCMain_main_closure;"),
@@ -1603,7 +1603,7 @@ mkExtraObjToLinkIntoBinary dflags = do
ptext (sLit " __conf.rts_opts_enabled = ")
<> text (show (rtsOptsEnabled dflags)) <> semi,
case rtsOpts dflags of
- Nothing -> empty
+ Nothing -> Outputable.empty
Just opts -> ptext (sLit " __conf.rts_opts= ") <>
text (show opts) <> semi,
ptext (sLit " __conf.rts_hs_main = rtsTrue;"),
@@ -1639,7 +1639,7 @@ mkNoteObjsToLinkIntoBinary dflags dep_packages = do
-- where we need to do this.
(if platformHasGnuNonexecStack (targetPlatform dflags)
then text ".section .note.GNU-stack,\"\",@progbits\n"
- else empty)
+ else Outputable.empty)
]
where
diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index c43064e7f1..b06f5bcb9c 100644
--- a/compiler/main/ErrUtils.lhs
+++ b/compiler/main/ErrUtils.lhs
@@ -55,7 +55,11 @@ import qualified Data.Set as Set
import Data.IORef
import Data.Ord
import Data.Time
+#if __GLASGOW_HASKELL__ >= 709
+import Control.Monad hiding (empty)
+#else
import Control.Monad
+#endif
import Control.Monad.IO.Class
import System.IO
diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs
index b5ad08b425..f56c173662 100644
--- a/compiler/main/Finder.lhs
+++ b/compiler/main/Finder.lhs
@@ -609,7 +609,7 @@ cantFindErr cannot_find _ dflags mod_name find_result
tried_these files
tried_these files
- | null files = empty
+ | null files = Outputable.empty
| verbosity dflags < 3 =
ptext (sLit "Use -v to see a list of the files searched for.")
| otherwise =
@@ -628,14 +628,14 @@ cantFindErr cannot_find _ dflags mod_name find_result
in ptext (sLit "Perhaps you need to add") <+>
quotes (ppr (packageName pkg)) <+>
ptext (sLit "to the build-depends in your .cabal file.")
- | otherwise = empty
+ | otherwise = Outputable.empty
mod_hidden pkg =
ptext (sLit "it is a hidden module in the package") <+> quotes (ppr pkg)
pp_suggestions :: [ModuleSuggestion] -> SDoc
pp_suggestions sugs
- | null sugs = empty
+ | null sugs = Outputable.empty
| otherwise = hang (ptext (sLit "Perhaps you meant"))
2 (vcat (map pp_sugg sugs))
@@ -643,7 +643,7 @@ cantFindErr cannot_find _ dflags mod_name find_result
-- package flags when making suggestions. ToDo: if the original package
-- also has a reexport, prefer that one
pp_sugg (SuggestVisible m mod o) = ppr m <+> provenance o
- where provenance ModHidden = empty
+ where provenance ModHidden = Outputable.empty
provenance (ModOrigin{ fromOrigPackage = e,
fromExposedReexport = res,
fromPackageFlag = f })
@@ -657,9 +657,9 @@ cantFindErr cannot_find _ dflags mod_name find_result
| f
= parens (ptext (sLit "defined via package flags to be")
<+> ppr mod)
- | otherwise = empty
+ | otherwise = Outputable.empty
pp_sugg (SuggestHidden m mod o) = ppr m <+> provenance o
- where provenance ModHidden = empty
+ where provenance ModHidden = Outputable.empty
provenance (ModOrigin{ fromOrigPackage = e,
fromHiddenReexport = rhs })
| Just False <- e
@@ -668,5 +668,5 @@ cantFindErr cannot_find _ dflags mod_name find_result
| (pkg:_) <- rhs
= parens (ptext (sLit "needs flag -package-key")
<+> ppr (packageConfigId pkg))
- | otherwise = empty
+ | otherwise = Outputable.empty
\end{code}
diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs
index fcf235bd23..c6d72b2cc9 100644
--- a/compiler/main/HeaderInfo.hs
+++ b/compiler/main/HeaderInfo.hs
@@ -300,7 +300,7 @@ unsupportedExtnError dflags loc unsup =
throw $ mkSrcErr $ unitBag $
mkPlainErrMsg dflags loc $
text "Unsupported extension: " <> text unsup $$
- if null suggestions then empty else text "Perhaps you meant" <+> quotedListWithOr (map text suggestions)
+ if null suggestions then Outputable.empty else text "Perhaps you meant" <+> quotedListWithOr (map text suggestions)
where
suggestions = fuzzyMatch unsup supportedLanguagesAndExtensions
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index 01c75c02d8..c14c8cf7f8 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -589,7 +589,7 @@ packageFlagErr dflags (ExposePackage (PackageArg pkg) _) []
packageFlagErr dflags flag reasons
= throwGhcExceptionIO (CmdLineError (showSDoc dflags $ err))
where err = text "cannot satisfy " <> pprFlag flag <>
- (if null reasons then empty else text ": ") $$
+ (if null reasons then Outputable.empty else text ": ") $$
nest 4 (ppr_reasons $$
-- ToDo: this admonition seems a bit dodgy
text "(use -v for more information)")
@@ -608,7 +608,7 @@ pprFlag flag = case flag of
PackageArg p -> text "-package " <> text p
PackageIdArg p -> text "-package-id " <> text p
PackageKeyArg p -> text "-package-key " <> text p
- ppr_rns Nothing = empty
+ ppr_rns Nothing = Outputable.empty
ppr_rns (Just rns) = char '(' <> hsep (punctuate comma (map ppr_rn rns))
<> char ')'
ppr_rn (orig, new) | orig == new = text orig
@@ -1374,7 +1374,7 @@ missingPackageMsg :: Outputable pkgid => pkgid -> SDoc
missingPackageMsg p = ptext (sLit "unknown package:") <+> ppr p
missingDependencyMsg :: Maybe PackageKey -> SDoc
-missingDependencyMsg Nothing = empty
+missingDependencyMsg Nothing = Outputable.empty
missingDependencyMsg (Just parent)
= space <> parens (ptext (sLit "dependency of") <+> ftext (packageKeyFS parent))