Commit f555abff authored by chevalier@alum.wellesley.edu's avatar chevalier@alum.wellesley.edu
Browse files

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.
parent 0a9b1362
......@@ -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, "(->)")
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment