Fix CodingStyle#Warnings URLs
[ghc-hetmet.git] / compiler / utils / Outputable.lhs
index 6d9132e..2462ea2 100644 (file)
@@ -7,6 +7,12 @@ Outputable: defines classes for pretty-printing and forcing, both
 forms of ``output.''
 
 \begin{code}
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
+-- for details
 
 module Outputable (
        Outputable(..), OutputableBndr(..),     -- Class
@@ -36,7 +42,7 @@ module Outputable (
        hang, punctuate,
        speakNth, speakNTimes, speakN, speakNOf, plural,
 
-       printSDoc, printErrs, printDump,
+       printSDoc, printErrs, hPrintDump, printDump,
        printForC, printForAsm, printForUser,
        pprCode, mkCodeStyle,
        showSDoc, showSDocForUser, showSDocDebug, showSDocDump,
@@ -258,9 +264,12 @@ printErrs doc = do Pretty.printDoc PageMode stderr doc
                   hFlush stderr
 
 printDump :: SDoc -> IO ()
-printDump doc = do
-   Pretty.printDoc PageMode stdout (better_doc defaultDumpStyle)
-   hFlush stdout
+printDump doc = hPrintDump stdout doc
+
+hPrintDump :: Handle -> SDoc -> IO ()
+hPrintDump h doc = do
+   Pretty.printDoc PageMode h (better_doc defaultDumpStyle)
+   hFlush h
  where
    better_doc = doc $$ text ""