summaryrefslogtreecommitdiff
path: root/libraries/template-haskell/Language
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/template-haskell/Language')
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/PprLib.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH/PprLib.hs b/libraries/template-haskell/Language/Haskell/TH/PprLib.hs
index bc88ae9786..230bd43a8f 100644
--- a/libraries/template-haskell/Language/Haskell/TH/PprLib.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/PprLib.hs
@@ -117,14 +117,14 @@ punctuate :: Doc -> [Doc] -> [Doc]; -- ^ @punctuate p [d1, ... dn] = [d1 \<
type State = (Map Name HPJ.Doc, Int)
data PprM a = PprM { runPprM :: State -> (a, State) }
-pprName :: Name -> Doc
-pprName n@(Name o (NameU _))
+pprName :: Bool -> Name -> Doc
+pprName pfx n@(Name o (NameU _))
= PprM $ \s@(fm, i@(I# i'))
-> case Map.lookup n fm of
Just d -> (d, s)
- Nothing -> let d = HPJ.text $ show $ Name o (NameU i')
+ Nothing -> let d = HPJ.text $ showName pfx $ Name o (NameU i')
in (d, (Map.insert n d fm, i + 1))
-pprName n = text $ show n
+pprName pfx n = text $ showName pfx n
{-
instance Show Name where