diff options
-rw-r--r-- | compiler/main/DynFlags.hs | 10 | ||||
-rw-r--r-- | compiler/utils/Outputable.hs | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 4b4eb77295..13f3bd744b 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -604,7 +604,10 @@ data WarningFlag = deriving (Eq, Show, Enum) data Language = Haskell98 | Haskell2010 - deriving Enum + deriving (Eq, Enum, Show) + +instance Outputable Language where + ppr = text . show -- | The various Safe Haskell modes data SafeHaskellMode @@ -1675,6 +1678,11 @@ Note [Verbosity levels] data OnOff a = On a | Off a + deriving (Eq, Show) + +instance Outputable a => Outputable (OnOff a) where + ppr (On x) = text "On" <+> ppr x + ppr (Off x) = text "Off" <+> ppr x -- OnOffs accumulate in reverse order, so we use foldr in order to -- process them in the right order diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index 1abb1c5b81..bf0cc905fc 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -95,6 +95,7 @@ import Platform import Pretty ( Doc, Mode(..) ) import Panic import GHC.Serialized +import GHC.LanguageExtensions (Extension) import Data.ByteString (ByteString) import qualified Data.ByteString as BS @@ -815,6 +816,9 @@ instance Outputable a => Outputable (SCC a) where instance Outputable Serialized where ppr (Serialized the_type bytes) = int (length bytes) <+> text "of type" <+> text (show the_type) +instance Outputable Extension where + ppr = text . show + {- ************************************************************************ * * |