From 34c2d268ed257a0ae063f8867adfb4144409dd38 Mon Sep 17 00:00:00 2001 From: panne Date: Mon, 12 Jun 2000 13:40:20 +0000 Subject: [PATCH 1/1] [project @ 2000-06-12 13:40:20 by panne] Pretty-printing EncodedStrings, next try... --- ghc/compiler/basicTypes/OccName.lhs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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} %************************************************************************ -- 1.7.10.4