aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/GHC/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/GHC/Utils.hs')
-rw-r--r--src/Haddock/GHC/Utils.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Haddock/GHC/Utils.hs b/src/Haddock/GHC/Utils.hs
index 26860116..5e8142e5 100644
--- a/src/Haddock/GHC/Utils.hs
+++ b/src/Haddock/GHC/Utils.hs
@@ -52,13 +52,10 @@ modulePkgStr = packageIdString . modulePackageId
-- misc
-isNameSymOcc = isSymOcc . nameOccName
-
--- there should be a better way to check this using the GHC API
-isConSym n = head (nameOccString n) == ':'
-isVarSym n = fstChar /= '_' && not (isConSym n) && (not . isLetter) fstChar
- where fstChar = head (nameOccString n)
+isNameSym = isSymOcc . nameOccName
+isNameVarSym = isLexVarSym . occNameFS . nameOccName
+isNameConSym = isLexConSym . occNameFS . nameOccName
getMainDeclBinder :: HsDecl name -> Maybe name