text, ftext, ptext,
int, integer, float, double, rational,
parens, cparen, brackets, braces, quotes, doubleQuotes, angleBrackets,
- semi, comma, colon, dcolon, space, equals, dot, arrow,
+ semi, comma, colon, dcolon, space, equals, dot, arrow, darrow,
lparen, rparen, lbrack, rbrack, lbrace, rbrace, underscore,
blankLine,
(<>), (<+>), hcat, hsep,
speakNth, speakNTimes, speakN, speakNOf, plural,
-- * Converting 'SDoc' into strings and outputing it
- printSDoc, printErrs, hPrintDump, printDump,
+ printSDoc, printErrs, printOutput, hPrintDump, printDump,
printForC, printForAsm, printForUser, printForUserPartWay,
pprCode, mkCodeStyle,
showSDoc, showSDocOneLine,
import Panic
import Data.Char
+import Data.Map (Map)
+import qualified Data.Map as M
import Data.Word
import System.IO ( Handle, stderr, stdout, hFlush )
import System.FilePath
printErrs doc = do Pretty.printDoc PageMode stderr doc
hFlush stderr
+printOutput :: Doc -> IO ()
+printOutput doc = Pretty.printDoc PageMode stdout doc
+
printDump :: SDoc -> IO ()
printDump doc = hPrintDump stdout doc
pp_d = d sty
semi, comma, colon, equals, space, dcolon, arrow, underscore, dot :: SDoc
-lparen, rparen, lbrack, rbrack, lbrace, rbrace, blankLine :: SDoc
+darrow, lparen, rparen, lbrack, rbrack, lbrace, rbrace, blankLine :: SDoc
blankLine _sty = Pretty.ptext (sLit "")
dcolon _sty = Pretty.ptext (sLit "::")
arrow _sty = Pretty.ptext (sLit "->")
+darrow _sty = Pretty.ptext (sLit "=>")
semi _sty = Pretty.semi
comma _sty = Pretty.comma
colon _sty = Pretty.colon
instance Outputable FastString where
ppr fs = ftext fs -- Prints an unadorned string,
-- no double quotes or anything
+
+instance (Outputable key, Outputable elt) => Outputable (Map key elt) where
+ ppr m = ppr (M.toList m)
\end{code}
%************************************************************************