aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
diff options
context:
space:
mode:
authorOleg Grenrus <oleg.grenrus@iki.fi>2015-09-27 20:50:15 +0300
committerOleg Grenrus <oleg.grenrus@iki.fi>2015-09-27 20:52:10 +0300
commit02e633a6f9b7ccb53a92a838c1b717ef9f3737fc (patch)
tree46c46675c7a434e7fa38f80cbc96038f1fcf2122 /haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
parentac10a4ccbe416e8612c6ca49b9f19c3a6f4cf25f (diff)
Generate docs for orphan instances
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Decl.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs17
1 files changed, 16 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index e536ae4b..031b40e5 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -16,7 +16,7 @@
module Haddock.Backends.Xhtml.Decl (
ppDecl,
- ppTyName, ppTyFamHeader, ppTypeApp,
+ ppTyName, ppTyFamHeader, ppTypeApp, ppOrphanInstances,
tyvarNames
) where
@@ -548,6 +548,21 @@ ppInstances links origin instances splice unicode qual
((ppInstHead links splice unicode qual mdoc origin no inst), loc)
+ppOrphanInstances :: LinksInfo
+ -> [DocInstance DocName]
+ -> Splice -> Unicode -> Qualification
+ -> Html
+ppOrphanInstances links instances splice unicode qual
+ = subOrphanInstances qual links True (zipWith instDecl [1..] instances)
+ where
+ instOrigin :: InstHead name -> InstOrigin name
+ instOrigin inst = OriginClass (ihdClsName inst)
+
+ instDecl :: Int -> DocInstance DocName -> (SubDecl,Located DocName)
+ instDecl no (inst, mdoc, loc) =
+ ((ppInstHead links splice unicode qual mdoc (instOrigin inst) no inst), loc)
+
+
ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification
-> Maybe (MDoc DocName)
-> InstOrigin DocName -> Int -> InstHead DocName