Get building GHC itself with Cabal more-or-less working
[ghc-hetmet.git] / compiler / utils / Pretty.lhs
index bebb6b2..7713d03 100644 (file)
@@ -152,6 +152,10 @@ Relative to John's original paper, there are the following new features:
 
 
 \begin{code}
+{-# OPTIONS -fno-warn-unused-imports #-}
+-- XXX GHC 6.9 seems to be confused by unpackCString# being used only in
+--     a RULE
+
 module Pretty (
         Doc,            -- Abstract
         Mode(..), TextDetails(..),
@@ -175,8 +179,6 @@ module Pretty (
         render, fullRender, printDoc, showDocWith
   ) where
 
-#include "HsVersions.h"
-
 import BufWrite
 import FastString
 import FastTypes
@@ -974,7 +976,7 @@ display mode page_width ribbon_width txt end doc
         lay2 _ _                   = panic "display/lay2: Unhandled case"
 
         -- optimise long indentations using LitString chunks of 8 spaces
-        indent n r | n >=# _ILIT(8) = LStr SLIT("        ") (_ILIT(8)) `txt`
+        indent n r | n >=# _ILIT(8) = LStr (sLit "        ") (_ILIT(8)) `txt`
                                       indent (n -# _ILIT(8)) r
                    | otherwise      = Str (spaces n) `txt` r
     in
@@ -996,8 +998,12 @@ spaces n | n <=# _ILIT(0) = ""
 
 \begin{code}
 pprCols :: Int
-pprCols = 120 -- could make configurable
+pprCols = 100 -- could make configurable
 
+-- NB. printDoc prints FastStrings in UTF-8: hPutFS below does no decoding.
+-- This is what we usually want, because the IO library has no encoding
+-- functionality, and we're assuming UTF-8 source code so we might as well
+-- assume UTF-8 output too.
 printDoc :: Mode -> Handle -> Doc -> IO ()
 printDoc LeftMode hdl doc
   = do { printLeftRender hdl doc; hFlush hdl }