Commit 927eebac authored by simonmar's avatar simonmar

[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
parent ded6a36f
......@@ -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
......
......@@ -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}
......
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