From: Ian Lynagh Date: Sat, 25 Nov 2006 15:23:07 +0000 (+0000) Subject: Add some Outputable instances X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=6c5705e398947a3b74a3f9b7cfb3dd93ca12b8e0 Add some Outputable instances --- diff --git a/compiler/basicTypes/BasicTypes.lhs b/compiler/basicTypes/BasicTypes.lhs index 35c57f3..7454be9 100644 --- a/compiler/basicTypes/BasicTypes.lhs +++ b/compiler/basicTypes/BasicTypes.lhs @@ -491,6 +491,10 @@ instance Outputable StrictnessMark where \begin{code} data SuccessFlag = Succeeded | Failed +instance Outputable SuccessFlag where + ppr Succeeded = ptext SLIT("Succeeded") + ppr Failed = ptext SLIT("Failed") + successIf :: Bool -> SuccessFlag successIf True = Succeeded successIf False = Failed diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs index e6e8e4c..a76ec5a 100644 --- a/compiler/main/HscTypes.lhs +++ b/compiler/main/HscTypes.lhs @@ -209,9 +209,15 @@ data TargetId pprTarget :: Target -> SDoc pprTarget (Target id _) = pprTargetId id +instance Outputable Target where + ppr = pprTarget + pprTargetId (TargetModule m) = ppr m pprTargetId (TargetFile f _) = text f +instance Outputable TargetId where + ppr = pprTargetId + type HomePackageTable = ModuleNameEnv HomeModInfo -- Domain = modules in the home package -- "home" package name cached here for convenience