[project @ 2005-08-02 14:56:50 by simonmar]
authorsimonmar <unknown>
Tue, 2 Aug 2005 14:56:50 +0000 (14:56 +0000)
committersimonmar <unknown>
Tue, 2 Aug 2005 14:56:50 +0000 (14:56 +0000)
- move instance Show FastString into FastString module
- instance Outputable FastString should use ftext instead of unpackFS

ghc/compiler/utils/FastString.lhs
ghc/compiler/utils/Outputable.lhs

index 661b89e..7a7d5f0 100644 (file)
@@ -127,6 +127,9 @@ instance Ord FastString where
             | otherwise        =  y
     compare a b = cmpFS a b
 
+instance Show FastString where
+   show fs = show (unpackFS fs)
+
 lengthFS :: FastString -> Int
 lengthFS (FastString _ l# _) = I# l#
 lengthFS (UnicodeStr _ s) = length s
index d337e7e..a88451d 100644 (file)
@@ -373,8 +373,8 @@ instance (Outputable a, Outputable b, Outputable c, Outputable d) =>
                   ppr w])
 
 instance Outputable FastString where
-    ppr fs = text (unpackFS fs)                -- Prints an unadorned string,
-                                       -- no double quotes or anything
+    ppr fs = ftext fs          -- Prints an unadorned string,
+                               -- no double quotes or anything
 
 instance Outputable PackageId where
    ppr pid = text (packageIdString pid)
@@ -420,9 +420,6 @@ pprHsChar c | c > '\x10ffff' = char '\\' <> text (show (fromIntegral (ord c) ::
 
 pprHsString :: FastString -> SDoc
 pprHsString fs = text (show (unpackFS fs))
-
-instance Show FastString  where
-    showsPrec p fs = showsPrecSDoc p (ppr fs)
 \end{code}