From 2f4ad4afb3e22e666f1968cba8e6c44089b77f25 Mon Sep 17 00:00:00 2001 From: David Waern Date: Thu, 8 Nov 2007 01:56:00 +0000 Subject: Small bugfix and cleanup in getDeclFromTyCls --- src/Haddock/Interface/Create.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 2634947b..800f099e 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -292,7 +292,7 @@ getDeclFromGroup group name = [lsig] -> Just (L (getLoc lsig) (SigD (unLoc lsig))) _ -> Nothing where - matching = [ lsig | L l (TypeSig (L _ n) _) <- lsigs, n == name ] + matching = [ s | s@(L l (TypeSig (L _ n) _)) <- lsigs, n == name ] getDeclFromVals _ = error "getDeclFromVals: illegal input" @@ -313,11 +313,12 @@ getDeclFromGroup group name = [ltycl] -> Just (L (getLoc ltycl) (TyClD (unLoc ltycl))) _ -> Nothing where - matching = [ fmap makeVanillaTyCl ltycl | ltycl <- ltycls, - name `elem` map unLoc (tyClDeclNames (unLoc ltycl))] + matching = [ fmap makeVanillaClass ltycl | ltycl <- ltycls, + name `elem` (map unLoc . tyClDeclNames . unLoc $ ltycl)] where - makeVanillaTyCl tycl = - tycl { tcdSigs = filter isVanillaLSig (tcdSigs tycl) } + makeVanillaClass tycl + | isClassDecl tycl = tycl { tcdSigs = filter isVanillaLSig (tcdSigs tycl) } + | otherwise = tycl getDeclFromFors lfors = case matching of [for] -> Just (L (getLoc for) (ForD (unLoc for))) -- cgit v1.2.3