aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Waern <davve@dtek.chalmers.se>2007-11-08 01:56:00 +0000
committerDavid Waern <davve@dtek.chalmers.se>2007-11-08 01:56:00 +0000
commit2f4ad4afb3e22e666f1968cba8e6c44089b77f25 (patch)
tree065e8d67c2d7d92cc47836b707ec7b673daf25f5
parent5e8ca3c6af372022eac4be631f64de574f1a072c (diff)
Small bugfix and cleanup in getDeclFromTyCls
-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)))