diff --git a/ghc/compiler/basicTypes/OccName.lhs b/ghc/compiler/basicTypes/OccName.lhs index 76cbbb06c50c322afe3fda619835f2861f5d9c3d..98eb7c17dd30851f6198eba5be7f7ba4d701db99 100644 --- a/ghc/compiler/basicTypes/OccName.lhs +++ b/ghc/compiler/basicTypes/OccName.lhs @@ -66,7 +66,19 @@ type EncodedString = String -- Encoded form pprEncodedFS :: EncodedFS -> SDoc -pprEncodedFS fs = ptext fs +pprEncodedFS fs + = getPprStyle $ \ sty -> + if userStyle sty then + let + s = decode (_UNPK_ fs) + c = head s + in + if startsVarSym c || startsConSym c then + parens (text s) + else + text s + else + ptext fs \end{code} %************************************************************************