Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch :
http://hackage.haskell.org/trac/ghc/changeset/2f63e686928fd6ae27f1851246cf922afb7f1edb >--------------------------------------------------------------- commit 2f63e686928fd6ae27f1851246cf922afb7f1edb Author: David Terei <[email protected]> Date: Mon Jun 6 19:45:36 2011 -0700 SafeHaskell: Change SafeHaskellMode to use Outputable vs Show >--------------------------------------------------------------- compiler/main/DynFlags.hs | 20 ++++++++++---------- ghc/InteractiveUI.hs | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 8563dd1..bec70c0 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -335,13 +335,13 @@ data SafeHaskellMode | Sf_Safe deriving (Eq) -instance Show SafeHaskellMode where - show Sf_None = "None" - show Sf_SafeImports = "SafeImports" - show Sf_SafeLanguage = "SafeLanguage" - show Sf_Trustworthy = "Trustworthy" - show Sf_TrustworthyWithSafeLanguage = "Trustworthy + SafeLanguage" - show Sf_Safe = "Safe" +instance Outputable SafeHaskellMode where + ppr Sf_None = ptext $ sLit "None" + ppr Sf_SafeImports = ptext $ sLit "SafeImports" + ppr Sf_SafeLanguage = ptext $ sLit "SafeLanguage" + ppr Sf_Trustworthy = ptext $ sLit "Trustworthy" + ppr Sf_TrustworthyWithSafeLanguage = ptext $ sLit "Trustworthy + SafeLanguage" + ppr Sf_Safe = ptext $ sLit "Safe" data ExtensionFlag = Opt_Cpp @@ -1036,7 +1036,7 @@ combineSafeFlags a b = | otherwise -> err where err = ghcError (CmdLineError $ "Incompatible SafeHaskell flags! (" - ++ show a ++ "," ++ show b ++ ")") + ++ showPpr a ++ "," ++ showPpr b ++ ")") -- | Retrieve the options corresponding to a particular @opt_*@ field in the correct order getOpts :: DynFlags -- ^ 'DynFlags' to retrieve the options from @@ -1795,8 +1795,8 @@ languageFlags = [ safeHaskellFlags :: [FlagSpec SafeHaskellMode] safeHaskellFlags = [mkF Sf_SafeImports, mkF' Sf_SafeLanguage, mkF Sf_Trustworthy, mkF' Sf_Safe] - where mkF flag = (show flag, AlwaysAllowed, flag, nop) - mkF' flag = (show flag, EnablesSafe, flag, nop) + where mkF flag = (showPpr flag, AlwaysAllowed, flag, nop) + mkF' flag = (showPpr flag, EnablesSafe, flag, nop) -- | These -X<blah> flags can all be reversed with -XNo<blah> xFlags :: [FlagSpec ExtensionFlag] diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index b4fc2aa..1869040 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -1354,7 +1354,7 @@ isSafeModule m = do let iface = GHC.modInfoIface mi case iface of Just iface' -> do - let trust = show $ getSafeMode $ GHC.mi_trust iface' + let trust = showPpr $ getSafeMode $ GHC.mi_trust iface' pkg = if packageTrusted dflags m then "trusted" else "untrusted" liftIO $ putStrLn $ "Trust type is (Module: " ++ trust ++ ", Package: " ++ pkg ++ ")" _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
