aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Interface
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/Interface')
-rw-r--r--src/Haddock/Interface/Create.hs11
1 files changed, 6 insertions, 5 deletions
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)))