- ppr fs = text (unpackFS fs) -- Prints an unadorned string,
- -- no double quotes or anything
-
-#if __GLASGOW_HASKELL__ < 410
--- Assume we have only 8-bit Chars.
-
-pprHsChar :: Int -> SDoc
-pprHsChar c = char '\'' <> text (showCharLit c "") <> char '\''
-
-pprHsString :: FAST_STRING -> SDoc
-pprHsString fs = doubleQuotes (text (foldr showCharLit "" (_UNPK_INT_ fs)))
-
-showCharLit :: Int -> String -> String
-showCharLit c rest
- | c == ord '\"' = "\\\"" ++ rest
- | c == ord '\'' = "\\\'" ++ rest
- | c == ord '\\' = "\\\\" ++ rest
- | c >= 0x20 && c <= 0x7E = chr c : rest
- | c == ord '\a' = "\\a" ++ rest
- | c == ord '\b' = "\\b" ++ rest
- | c == ord '\f' = "\\f" ++ rest
- | c == ord '\n' = "\\n" ++ rest
- | c == ord '\r' = "\\r" ++ rest
- | c == ord '\t' = "\\t" ++ rest
- | c == ord '\v' = "\\v" ++ rest
- | otherwise = ('\\':) $ shows c $ case rest of
- d:_ | isDigit d -> "\\&" ++ rest
- _ -> rest
-
-#else
--- We have 31-bit Chars and will simply use Show instances
--- of Char and String.