From 629ff801073bb90a968dbc882b0c443d13e4d92e Mon Sep 17 00:00:00 2001 From: "david.waern" Date: Thu, 18 Mar 2010 22:22:27 +0000 Subject: Fix build with GHC 6.12.1 --- src/Haddock/GhcUtils.hs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/Haddock/GhcUtils.hs') diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 5c481586..c0d6707c 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -90,10 +90,18 @@ isVarSym = isLexVarSym . occNameFS getMainDeclBinder :: HsDecl name -> Maybe name getMainDeclBinder (TyClD d) = Just (tcdName d) -getMainDeclBinder (ValD d) - = case collectHsBindBinders d of - [] -> Nothing - (name:_) -> Just name +getMainDeclBinder (ValD d) = +#if __GLASGOW_HASKELL__ == 612 + case collectAcc d [] of + [] -> Nothing + (name:_) -> Just (unLoc name) +#else + case collectHsBindBinders d of + [] -> Nothing + (name:_) -> Just name +#endif + + getMainDeclBinder (SigD d) = sigNameNoLoc d getMainDeclBinder (ForD (ForeignImport name _ _)) = Just (unLoc name) getMainDeclBinder (ForD (ForeignExport _ _ _)) = Nothing -- cgit v1.2.3