[commit: ghc] master: De-orphan the Outputable Fingerprint instance (e9a587a)
Ian Lynagh
igloo at earth.li
Sun Aug 5 17:38:55 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/e9a587a120dd6e71dd78291366d2a4eb8c0bedd3
>---------------------------------------------------------------
commit e9a587a120dd6e71dd78291366d2a4eb8c0bedd3
Author: Ian Lynagh <ian at well-typed.com>
Date: Sun Aug 5 16:07:11 2012 +0100
De-orphan the Outputable Fingerprint instance
>---------------------------------------------------------------
compiler/utils/Fingerprint.hsc | 7 -------
compiler/utils/Outputable.lhs | 5 +++++
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/compiler/utils/Fingerprint.hsc b/compiler/utils/Fingerprint.hsc
index 5f9bef1..e006598 100644
--- a/compiler/utils/Fingerprint.hsc
+++ b/compiler/utils/Fingerprint.hsc
@@ -8,7 +8,6 @@
--
-- ----------------------------------------------------------------------------
-{-# OPTIONS_GHC -fno-warn-orphans #-}
module Fingerprint (
Fingerprint(..), fingerprint0,
readHexFingerprint,
@@ -19,16 +18,10 @@ module Fingerprint (
#include "md5.h"
##include "HsVersions.h"
-import Outputable
-
-import Text.Printf
import Numeric ( readHex )
import GHC.Fingerprint
-instance Outputable Fingerprint where
- ppr (Fingerprint w1 w2) = text (printf "%016x%016x" w1 w2)
-
-- useful for parsing the output of 'md5sum', should we want to do that.
readHexFingerprint :: String -> Fingerprint
readHexFingerprint s = Fingerprint w1 w2
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs
index 8b49d30..a6d188a 100644
--- a/compiler/utils/Outputable.lhs
+++ b/compiler/utils/Outputable.lhs
@@ -92,7 +92,9 @@ import qualified Data.Set as Set
import Data.Word
import System.IO ( Handle )
import System.FilePath
+import Text.Printf
+import GHC.Fingerprint
import GHC.Show ( showMultiLineString )
\end{code}
@@ -689,6 +691,9 @@ instance (Outputable key, Outputable elt) => Outputable (M.Map key elt) where
ppr m = ppr (M.toList m)
instance (Outputable elt) => Outputable (IM.IntMap elt) where
ppr m = ppr (IM.toList m)
+
+instance Outputable Fingerprint where
+ ppr (Fingerprint w1 w2) = text (printf "%016x%016x" w1 w2)
\end{code}
%************************************************************************
More information about the Cvs-ghc
mailing list