aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/GhcUtils.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2011-11-06 00:47:21 +0100
committerDavid Waern <david.waern@gmail.com>2011-11-06 01:20:37 +0100
commitf19cc291ca05b0a7fc8f716007224216c74e22a2 (patch)
treea1bf9648326ed5a2364de8c3edc87f6ee87810ff /src/Haddock/GhcUtils.hs
parent2f1036494c17b8bc38ec8b63d12d3944a0054e3b (diff)
Use getDeclMainBinder instead of declNames.
Diffstat (limited to 'src/Haddock/GhcUtils.hs')
-rw-r--r--src/Haddock/GhcUtils.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs
index 33ae1b6d..d5423bee 100644
--- a/src/Haddock/GhcUtils.hs
+++ b/src/Haddock/GhcUtils.hs
@@ -85,21 +85,15 @@ isVarSym = isLexVarSym . occNameFS
getMainDeclBinder :: HsDecl name -> [name]
getMainDeclBinder (TyClD d) = [tcdName d]
getMainDeclBinder (ValD d) =
-#if __GLASGOW_HASKELL__ == 612
- case collectAcc d [] of
- [] -> []
- (name:_) -> [unLoc name]
-#else
case collectHsBindBinders d of
[] -> []
(name:_) -> [name]
-#endif
-
getMainDeclBinder (SigD d) = sigNameNoLoc d
getMainDeclBinder (ForD (ForeignImport name _ _ _)) = [unLoc name]
getMainDeclBinder (ForD (ForeignExport _ _ _ _)) = []
getMainDeclBinder _ = []
+
-- Useful when there is a signature with multiple names, e.g.
-- foo, bar :: Types..
-- but only one of the names is exported and we have to change the