X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fext-core%2FPrinter.hs;h=0ae4b18f5029a11b65b2def7e273038b0372593e;hb=d97181b732076e19bbc109e6cc6393132a25af12;hp=0cd8b09adf84f0c01b41833462f9d7eed6943008;hpb=2ad4df602e5bb2cff0315b945fa3201749878c30;p=ghc-hetmet.git diff --git a/utils/ext-core/Printer.hs b/utils/ext-core/Printer.hs index 0cd8b09..0ae4b18 100644 --- a/utils/ext-core/Printer.hs +++ b/utils/ext-core/Printer.hs @@ -66,14 +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 +ptdef (Newtype qtcon coercion tbinds tyopt) = + text "%newtype" <+> pqname qtcon <+> pqname coercion + <+> (hsep (map ptbind tbinds)) $$ indent repclause + where repclause = case tyopt of Just ty -> char '=' <+> pty ty Nothing -> empty @@ -89,7 +85,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: @@ -143,6 +139,8 @@ pty (LeftCoercion t) = (pqname leftCoercion <+> paty t) pty (RightCoercion t) = (pqname rightCoercion <+> paty t) +pty (InstCoercion t1 t2) = + (sep [pqname instCoercion, paty t1, paty t2]) pty t = pbty t pappty (Tapp t1 t2) ts = pappty t1 (t2:ts)