summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorJose Pedro Magalhaes <jpm@cs.uu.nl>2011-11-11 09:07:11 +0000
committerJose Pedro Magalhaes <jpm@cs.uu.nl>2011-11-11 09:09:23 +0000
commit09015be8d580bc33f5f1960c8e31d00ba7a459a1 (patch)
treec7efea03f85327c35d875257679a73520408c3e9 /compiler/utils
parentfd742437b9e5933da145aea1e80766990c649a15 (diff)
downloadhaskell-09015be8d580bc33f5f1960c8e31d00ba7a459a1.tar.gz
New kind-polymorphic core
This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Outputable.lhs5
-rw-r--r--compiler/utils/Pretty.lhs9
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 ']'