- External mod mb_p -> pprExternal sty name uniq mod occ mb_p False
- WiredIn mod mb_p thing -> pprExternal sty name uniq mod occ mb_p True
- System -> pprSystem sty uniq occ
- Internal -> pprInternal sty uniq occ
-
-pprExternal sty name uniq mod occ mb_p is_wired
- | codeStyle sty = ppr (moduleName mod) <> char '_' <> pprOccName occ
- | debugStyle sty = sep [ppr (moduleName mod) <> dot <> pprOccName occ,
- hsep [text "{-",
- if is_wired then ptext SLIT("(w)") else empty,
- pprUnique uniq,
- case mb_p of
- Nothing -> empty
- Just n -> brackets (ppr n),
- text "-}"]]
- | unqualStyle sty name = pprOccName occ
- | otherwise = ppr (moduleName mod) <> dot <> pprOccName occ
+ WiredIn mod _ _ BuiltInSyntax -> pprOccName occ -- Built-in syntax is never qualified
+ WiredIn mod _ _ UserSyntax -> pprExternal sty uniq mod occ True
+ External mod _ -> pprExternal sty uniq mod occ False
+ System -> pprSystem sty uniq occ
+ Internal -> pprInternal sty uniq occ
+
+pprExternal sty uniq mod occ is_wired
+ | unqualStyle sty mod_name occ = pprOccName occ
+ | codeStyle sty = ppr mod_name <> char '_' <> pprOccName occ
+ | debugStyle sty = sep [ppr mod_name <> dot <> pprOccName occ,
+ hsep [text "{-"
+ , if is_wired then ptext SLIT("(w)") else empty
+ , pprUnique uniq
+-- (overkill) , case mb_p of
+-- Nothing -> empty
+-- Just n -> brackets (ppr n)
+ , text "-}"]]
+ | otherwise = ppr mod_name <> dot <> pprOccName occ
+ where
+ mod_name = moduleName mod