From: panne Date: Mon, 12 Jun 2000 13:40:20 +0000 (+0000) Subject: [project @ 2000-06-12 13:40:20 by panne] X-Git-Tag: Approximately_9120_patches~4283 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=34c2d268ed257a0ae063f8867adfb4144409dd38;hp=8f320598066b0b22e6a1d8f485b5ace7f87578fa;p=ghc-hetmet.git [project @ 2000-06-12 13:40:20 by panne] Pretty-printing EncodedStrings, next try... --- diff --git a/ghc/compiler/basicTypes/OccName.lhs b/ghc/compiler/basicTypes/OccName.lhs index 98eb7c1..94b50bb 100644 --- a/ghc/compiler/basicTypes/OccName.lhs +++ b/ghc/compiler/basicTypes/OccName.lhs @@ -68,17 +68,10 @@ type EncodedString = String -- Encoded form pprEncodedFS :: EncodedFS -> SDoc 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 + if userStyle sty + -- ptext (decodeFS fs) would needlessly pack the string again + then text (decode (_UNPK_ fs)) + else ptext fs \end{code} %************************************************************************