diff options
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/Outputable.lhs | 5 | ||||
-rw-r--r-- | compiler/utils/Pretty.lhs | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index d69e8ada63..60fbe5b29a 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -30,7 +30,7 @@ module Outputable ( char, text, ftext, ptext, int, integer, float, double, rational, - parens, cparen, brackets, braces, quotes, doubleQuotes, angleBrackets, + parens, cparen, brackets, braces, quotes, quote, doubleQuotes, angleBrackets, semi, comma, colon, dcolon, space, equals, dot, arrow, darrow, lparen, rparen, lbrack, rbrack, lbrace, rbrace, underscore, blankLine, @@ -449,11 +449,12 @@ float n = docToSDoc $ Pretty.float n double n = docToSDoc $ Pretty.double n rational n = docToSDoc $ Pretty.rational n -parens, braces, brackets, quotes, doubleQuotes, angleBrackets :: SDoc -> SDoc +parens, braces, brackets, quotes, quote, doubleQuotes, angleBrackets :: SDoc -> SDoc parens d = SDoc $ Pretty.parens . runSDoc d braces d = SDoc $ Pretty.braces . runSDoc d brackets d = SDoc $ Pretty.brackets . runSDoc d +quote d = SDoc $ Pretty.quote . runSDoc d doubleQuotes d = SDoc $ Pretty.doubleQuotes . runSDoc d angleBrackets d = char '<' <> d <> char '>' diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs index 0493daabee..cc8f235f2c 100644 --- a/compiler/utils/Pretty.lhs +++ b/compiler/utils/Pretty.lhs @@ -106,7 +106,7 @@ Relative to John's original paper, there are the following new features: These new ones do the obvious things: char, semi, comma, colon, space, parens, brackets, braces, - quotes, doubleQuotes + quotes, quote, doubleQuotes 4. The "above" combinator, $$, now overlaps its two arguments if the last line of the top argument stops before the first line of the second begins. @@ -165,7 +165,7 @@ module Pretty ( char, text, ftext, ptext, zeroWidthText, int, integer, float, double, rational, - parens, brackets, braces, quotes, doubleQuotes, + parens, brackets, braces, quotes, quote, doubleQuotes, semi, comma, colon, space, equals, lparen, rparen, lbrack, rbrack, lbrace, rbrace, cparen, @@ -233,8 +233,8 @@ char :: Char -> Doc semi, comma, colon, space, equals :: Doc lparen, rparen, lbrack, rbrack, lbrace, rbrace :: Doc -parens, brackets, braces :: Doc -> Doc -quotes, doubleQuotes :: Doc -> Doc +parens, brackets, braces :: Doc -> Doc +quotes, quote, doubleQuotes :: Doc -> Doc int :: Int -> Doc integer :: Integer -> Doc @@ -409,6 +409,7 @@ rational n = text (show (fromRat n :: Double)) --rational n = text (show (fromRationalX n)) -- _showRational 30 n) quotes p = char '`' <> p <> char '\'' +quote p = char '\'' <> p doubleQuotes p = char '"' <> p <> char '"' parens p = char '(' <> p <> char ')' brackets p = char '[' <> p <> char ']' |