X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fext-core%2FPrinter.hs;h=0acdc5dd3e8bee6400a835255224cb4885ddf622;hb=8bfeb25ae78e99c7014113468b0057342db4208f;hp=2649a0015a92ee5983267f40974761e438458529;hpb=10704b34c1928dde3d0ef33fe37c3eb7b948975f;p=ghc-hetmet.git diff --git a/utils/ext-core/Printer.hs b/utils/ext-core/Printer.hs index 2649a00..0acdc5d 100644 --- a/utils/ext-core/Printer.hs +++ b/utils/ext-core/Printer.hs @@ -66,16 +66,10 @@ ptdef (Data qtcon tbinds cdefs) = (text "%data" <+> pqname qtcon <+> (hsep (map ptbind tbinds)) <+> char '=') $$ indent (braces ((vcat (punctuate (char ';') (map pcdef cdefs))))) -ptdef (Newtype qtcon tbinds (coercion,cTbs,k) tyopt) = - text "%newtype" <+> pqname qtcon <+> (hsep (map ptbind tbinds)) - $$ indent (axiomclause $$ repclause) - where axiomclause = char '^' <+> parens (pqname coercion <+> - (hsep (map ptbind cTbs)) <+> - text "::" - <+> peqkind k) - repclause = case tyopt of - Just ty -> char '=' <+> pty ty - Nothing -> empty +ptdef (Newtype qtcon coercion tbinds tyopt) = + text "%newtype" <+> pqname qtcon <+> pqname coercion + <+> (hsep (map ptbind tbinds)) $$ indent repclause + where repclause = char '=' <+> pty tyopt pcdef (Constr qdcon tbinds tys) = (pqname qdcon) <+> (sep [hsep (map pattbind tbinds),sep (map paty tys)]) @@ -89,7 +83,7 @@ pqname (m,v) = pmname m <> pname v pmname Nothing = empty pmname (Just m) = panmname m <> char '.' -panmname (M (pkgName, parents, name)) = +panmname (M (P pkgName, parents, name)) = let parentStrs = map pname parents in pname pkgName <> char ':' <> -- This is to be sure to not print out: