diff options
Diffstat (limited to 'haddock-api/src/Haddock')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs index 3b3d95b9..c127ebbd 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs @@ -241,7 +241,15 @@ findFreshName taken = alternativeNames :: OccName -> [OccName] -alternativeNames name = +alternativeNames name + | [_] <- occNameString name = letterNames ++ alternativeNames' name + where + letterNames = map (mkVarOcc . pure) ['a'..'z'] +alternativeNames name = alternativeNames' name + + +alternativeNames' :: OccName -> [OccName] +alternativeNames' name = [ mkVarOcc $ str ++ show i | i :: Int <- [0..] ] where str = occNameString name |