Commit 2ad46a86 authored by Oleg Grenrus's avatar Oleg Grenrus Committed by Ben Gamari

Add some Outputable instances

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1865
parent ba88aab0
......@@ -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
......
......@@ -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
{-
************************************************************************
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment