[commit: haddock] v2.16: Print orphan instances header only if required (b3e5ef8)
git at git.haskell.org
git at git.haskell.org
Tue Nov 28 11:43:53 UTC 2017
Repository : ssh://git@git.haskell.org/haddock
On branch : v2.16
Link : http://git.haskell.org/haddock.git/commitdiff/b3e5ef8b70d6e06e79b599348cbdd617d15478de
>---------------------------------------------------------------
commit b3e5ef8b70d6e06e79b599348cbdd617d15478de
Author: Oleg Grenrus <oleg.grenrus at iki.fi>
Date: Mon Sep 28 07:24:58 2015 +0300
Print orphan instances header only if required
>---------------------------------------------------------------
b3e5ef8b70d6e06e79b599348cbdd617d15478de
haddock-api/src/Haddock/Backends/Xhtml.hs | 2 +-
haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index fce9581..de4e8a1 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -564,7 +564,7 @@ ifaceToHtml maybe_source_url maybe_wiki_url iface unicode qual
foldr (+++) noHtml $
mapMaybe (processExport False linksInfo unicode qual) exports
- orphans = (h1 << "Orphan instances") +++
+ orphans =
ppOrphanInstances linksInfo (ifaceRnOrphanInstances iface) False unicode qual
linksInfo = (maybe_source_url, maybe_wiki_url)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
index b20cd17..3c13249 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
@@ -204,8 +204,9 @@ subInstances qual nm lnks splice = maybe noHtml wrap . instTable
subOrphanInstances :: Qualification
-> LinksInfo -> Bool
-> [(SubDecl,Located DocName)] -> Html
-subOrphanInstances qual lnks splice = maybe noHtml id . instTable
+subOrphanInstances qual lnks splice = maybe noHtml wrap . instTable
where
+ wrap = ((h1 << "Orphan instances") +++)
instTable = fmap (thediv ! collapseSection id_ True [] <<) . subTableSrc qual lnks splice
id_ = makeAnchorId $ "orphans"
More information about the ghc-commits
mailing list