aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Interface/Create.hs
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2018-02-19 05:56:54 +0100
committeralexbiehl <alex.biehl@gmail.com>2018-02-19 05:57:02 +0100
commit6d62c5b79d0f3ce975c087b5176ee53d62122d86 (patch)
tree68c0bd5418a03a49f9a927231a05482edfc162f7 /haddock-api/src/Haddock/Interface/Create.hs
parent5141e4b76af8462e49abdf48e44bb9cddb183383 (diff)
Teach the HTML backend how to render methods with multiple names
Diffstat (limited to 'haddock-api/src/Haddock/Interface/Create.hs')
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs26
1 files changed, 1 insertions, 25 deletions
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index f218853b..a885b298 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -392,7 +392,7 @@ mkMaps dflags gre instances decls = do
subNs = [ n | (n, _, _) <- subs ]
dm = [ (n, d) | (n, Just d) <- zip ns (repeat doc) ++ zip subNs subDocs ]
am = [ (n, args) | n <- ns ] ++ zip subNs subArgs
- cm = [ (n, expandSigDecls [ldecl]) | n <- ns ++ subNs ]
+ cm = [ (n, [ldecl]) | n <- ns ++ subNs ]
seqList ns `seq`
seqList subNs `seq`
@@ -559,30 +559,6 @@ filterDecls = filter (isHandled . unL . fst)
isHandled (DocD _) = True
isHandled _ = False
--- | A type signature can have multiple names, like:
--- foo, bar :: Types..
---
--- We go through the list of declarations and expand type signatures, so
--- that every type signature has exactly one name!
-expandSigDecls :: [LHsDecl name] -> [LHsDecl name]
-expandSigDecls = concatMap f
- where
- f (L l (SigD sig)) = [ L l (SigD s) | s <- expandSig sig ]
-
- -- also expand type signatures for class methods
- f (L l (TyClD cls@ClassDecl{})) =
- [ L l (TyClD cls { tcdSigs = concatMap expandLSig (tcdSigs cls) }) ]
- f x = [x]
-
-expandLSig :: LSig name -> [LSig name]
-expandLSig (L l sig) = [ L l s | s <- expandSig sig ]
-
-expandSig :: Sig name -> [Sig name]
-expandSig (TypeSig names t) = [ TypeSig [n] t | n <- names ]
-expandSig (ClassOpSig b names t) = [ ClassOpSig b [n] t | n <- names ]
-expandSig (PatSynSig names t) = [ PatSynSig [n] t | n <- names ]
-expandSig x = [x]
-
-- | Go through all class declarations and filter their sub-declarations
filterClasses :: [(LHsDecl a, doc)] -> [(LHsDecl a, doc)]
filterClasses decls = [ if isClassD d then (L loc (filterClass d), doc) else x