diff options
author | Stefan O'Rear <stefanor@cox.net> | 2007-04-01 16:48:14 +0000 |
---|---|---|
committer | Stefan O'Rear <stefanor@cox.net> | 2007-04-01 16:48:14 +0000 |
commit | 5a9552b71da157e0066eef14cf24c892413ad3cc (patch) | |
tree | 2d6357620eda0f7ecac46b49a6077916cad46096 /libraries/template-haskell/Language/Haskell/TH | |
parent | ddf3e701a7a4038faad60df767d90b1778c4bd01 (diff) | |
download | haskell-5a9552b71da157e0066eef14cf24c892413ad3cc.tar.gz |
Thread prefix-context argument through pprName
Diffstat (limited to 'libraries/template-haskell/Language/Haskell/TH')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/PprLib.hs | 8 |
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 |