diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2018-12-17 09:25:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-17 09:25:10 -0500 |
commit | ed43757aa371f9a532665783e27cff1703b4ac90 (patch) | |
tree | d797068322124edcd022ebb1a2873a8b7157f0bf /haddock-api/src/Haddock/GhcUtils.hs | |
parent | 1380f7fa048ba26f79944452722dff0800b49038 (diff) |
Refactor names + unused functions (#982)
This commit should not introduce any change in functionality!
* consistently use `getOccString` to convert `Name`s to strings
* compare names directly when possible (instead of comparing strings)
* get rid of unused utility functions
Diffstat (limited to 'haddock-api/src/Haddock/GhcUtils.hs')
-rw-r--r-- | haddock-api/src/Haddock/GhcUtils.hs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 1acfb25b..7f45bb61 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -25,7 +25,6 @@ import Exception import Outputable import Name import NameSet -import Lexeme import Module import HscTypes import GHC @@ -39,14 +38,6 @@ moduleString = moduleNameString . moduleName isNameSym :: Name -> Bool isNameSym = isSymOcc . nameOccName - -isVarSym :: OccName -> Bool -isVarSym = isLexVarSym . occNameFS - -isConSym :: OccName -> Bool -isConSym = isLexConSym . occNameFS - - getMainDeclBinder :: (SrcSpanLess (LPat p) ~ Pat p , HasSrcSpan (LPat p)) => HsDecl p -> [IdP p] getMainDeclBinder (TyClD _ d) = [tcdName d] @@ -141,12 +132,6 @@ isValD :: HsDecl a -> Bool isValD (ValD _ _) = True isValD _ = False - -declATs :: HsDecl a -> [IdP a] -declATs (TyClD _ d) | isClassDecl d = map (unL . fdLName . unL) $ tcdATs d -declATs _ = [] - - pretty :: Outputable a => DynFlags -> a -> String pretty = showPpr |