-getIfaceExt :: ((Name -> IfaceExtName) -> SDoc) -> SDoc
--- Uses the print-unqual info from the SDoc to make an 'ext'
--- which in turn tells toIfaceType when to make a qualified name
--- This is only used when making Iface stuff to print out for the user;
--- e.g. we use this in pprType
-getIfaceExt thing_inside
- = getPprStyle $ \ sty ->
- let
- ext nm | unqualStyle sty nm = LocalTop (nameOccName nm)
- | isInternalName nm = LocalTop (nameOccName nm)
- -- This only happens for Kind constructors, which
- -- don't come from any particular module and are unqualified
- -- This hack will go away when kinds are separated from types
- | otherwise = ExtPkg (nameModuleName nm) (nameOccName nm)
- in
- thing_inside ext
+pprExt :: ModuleName -> OccName -> SDoc
+pprExt mod occ
+ = getPprStyle $ \ sty ->
+ if unqualStyle sty mod occ then
+ ppr occ
+ else
+ ppr mod <> dot <> ppr occ