summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Outputable.lhs5
-rw-r--r--compiler/utils/Platform.hs1
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs
index 136a1a2151..cd5d2f8531 100644
--- a/compiler/utils/Outputable.lhs
+++ b/compiler/utils/Outputable.lhs
@@ -622,6 +622,8 @@ instance Outputable Bool where
instance Outputable Int where
ppr n = int n
+instance PlatformOutputable Int where
+ pprPlatform _ = ppr
instance Outputable Word16 where
ppr n = integer $ fromIntegral n
@@ -651,6 +653,9 @@ instance (PlatformOutputable a, PlatformOutputable b) => PlatformOutputable (a,
instance Outputable a => Outputable (Maybe a) where
ppr Nothing = ptext (sLit "Nothing")
ppr (Just x) = ptext (sLit "Just") <+> ppr x
+instance PlatformOutputable a => PlatformOutputable (Maybe a) where
+ pprPlatform _ Nothing = ptext (sLit "Nothing")
+ pprPlatform platform (Just x) = ptext (sLit "Just") <+> pprPlatform platform x
instance (Outputable a, Outputable b) => Outputable (Either a b) where
ppr (Left x) = ptext (sLit "Left") <+> ppr x
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 28532aa7f0..362d7822d0 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -28,6 +28,7 @@ data Platform
= Platform
{ platformArch :: Arch
, platformOS :: OS }
+ deriving (Show, Eq)
-- | Architectures that the native code generator knows about.