aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/GHC/Utils.hs
diff options
context:
space:
mode:
authorDavid Waern <davve@dtek.chalmers.se>2007-09-29 14:15:37 +0000
committerDavid Waern <davve@dtek.chalmers.se>2007-09-29 14:15:37 +0000
commit3f683df722c3c2b7aba70d15daf95593fd6be96d (patch)
tree01d370d2e8323cf4089fba653923a9f1abb7db3b /src/Haddock/GHC/Utils.hs
parente390c635fc817df5da56c67a72988fe77f2b0318 (diff)
Use isLexConSym/isLexVarSym from OccName
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