From 927eebacf4d6143067f7712aa0d4a3894b0bc044 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 2 Aug 2005 14:56:50 +0000 Subject: [PATCH] [project @ 2005-08-02 14:56:50 by simonmar] - move instance Show FastString into FastString module - instance Outputable FastString should use ftext instead of unpackFS --- ghc/compiler/utils/FastString.lhs | 3 +++ ghc/compiler/utils/Outputable.lhs | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ghc/compiler/utils/FastString.lhs b/ghc/compiler/utils/FastString.lhs index 661b89e..7a7d5f0 100644 --- a/ghc/compiler/utils/FastString.lhs +++ b/ghc/compiler/utils/FastString.lhs @@ -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 diff --git a/ghc/compiler/utils/Outputable.lhs b/ghc/compiler/utils/Outputable.lhs index d337e7e..a88451d 100644 --- a/ghc/compiler/utils/Outputable.lhs +++ b/ghc/compiler/utils/Outputable.lhs @@ -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} -- 1.7.10.4