Commit e9a587a1 authored by ian@well-typed.com's avatar ian@well-typed.com

De-orphan the Outputable Fingerprint instance

parent be691e1f
......@@ -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
......
......@@ -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}
%************************************************************************
......
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