External Core tools: track new syntax for newtypes
[ghc-hetmet.git] / utils / ext-core / Printer.hs
index 4e42445..0acdc5d 100644 (file)
@@ -69,9 +69,7 @@ ptdef (Data qtcon tbinds cdefs) =
 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
+       where repclause = char '=' <+> pty tyopt
 
 pcdef (Constr qdcon tbinds tys)  =
   (pqname qdcon) <+> (sep [hsep (map pattbind tbinds),sep (map paty tys)])
@@ -85,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: