From f555abffd676544cd13d022bf1eb829e63f7aebe Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 28 Mar 2008 22:26:30 +0000 Subject: [PATCH] External Core: print function types correctly, improve newtype pretty-printing - In a previous patch I broke the printing of fully-applied arrow types (e.g., "a -> b" was "(ghczmprim:GHCziPrim a b)") by z-encoding package names and not updating the primitive module name as defined in External Core accordingly. Fixed. (Mega sigh...) - Make newtype decls print slightly more readably. --- compiler/coreSyn/ExternalCore.lhs | 2 +- compiler/coreSyn/PprExternalCore.lhs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/coreSyn/ExternalCore.lhs b/compiler/coreSyn/ExternalCore.lhs index 5754f84..2a8d152 100644 --- a/compiler/coreSyn/ExternalCore.lhs +++ b/compiler/coreSyn/ExternalCore.lhs @@ -86,7 +86,7 @@ type Id = String primMname :: Mname -- For truly horrible reasons, this must be z-encoded. -- With any hope, the z-encoding will die soon. -primMname = "ghc-prim:GHCziPrim" +primMname = "ghczmprim:GHCziPrim" tcArrow :: Qual Tcon tcArrow = (primMname, "(->)") diff --git a/compiler/coreSyn/PprExternalCore.lhs b/compiler/coreSyn/PprExternalCore.lhs index dd75b62..791e36b 100644 --- a/compiler/coreSyn/PprExternalCore.lhs +++ b/compiler/coreSyn/PprExternalCore.lhs @@ -61,7 +61,7 @@ ptdef (Newtype tcon tbinds (coercion,k) rep) = -- At the same time, we need the newtype decl to declare the tycon itself. -- Sigh. text "%newtype" <+> pqname tcon <+> (hsep (map ptbind tbinds)) - <+> axiomclause <+> repclause + $$ indent (axiomclause $$ repclause) where axiomclause = char '^' <+> parens (pqname coercion <+> text "::" <+> pkind k) repclause = case rep of -- 1.7.10.4