[commit: haddock] 2.17.3.1-spanfix, alexbiehl-patch-1, ghc-8.0, ghc-8.0-facebook, ghc-head, ghc-head1, haddock-quick, headdock-library-1.4.5, ie_avails, issue-303, issue-475, master, pr-filter-maps, pr/cabal-desc, travis, v2.16, v2.17, v2.17.3, v2.18, wip-located-module-as, wip/D2418, wip/T11080-open-data-kinds, wip/T11258, wip/T11430, wip/T12105, wip/T12105-2, wip/T12942, wip/T13163, wip/T14529, wip/T3384, wip/embelleshed-rdr, wip/new-tree-one-param, wip/rae, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Rearrange layout of instance methods in generated documentation. (88df578)

git at git.haskell.org git at git.haskell.org
Tue Nov 28 11:35:40 UTC 2017


Repository : ssh://git@git.haskell.org/haddock

On branches: 2.17.3.1-spanfix,alexbiehl-patch-1,ghc-8.0,ghc-8.0-facebook,ghc-head,ghc-head1,haddock-quick,headdock-library-1.4.5,ie_avails,issue-303,issue-475,master,pr-filter-maps,pr/cabal-desc,travis,v2.16,v2.17,v2.17.3,v2.18,wip-located-module-as,wip/D2418,wip/T11080-open-data-kinds,wip/T11258,wip/T11430,wip/T12105,wip/T12105-2,wip/T12942,wip/T13163,wip/T14529,wip/T3384,wip/embelleshed-rdr,wip/new-tree-one-param,wip/rae,wip/remove-frames,wip/remove-frames1,wip/revert-ttg-2017-11-20,wip/ttg-2017-10-13,wip/ttg-2017-10-31,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13,wip/ttg6-unrevert-2017-11-22
Link       : http://git.haskell.org/haddock.git/commitdiff/88df578a8573908d665d4597c4c619c29055a277

>---------------------------------------------------------------

commit 88df578a8573908d665d4597c4c619c29055a277
Author: Ɓukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Tue Jul 28 23:58:13 2015 +0200

    Rearrange layout of instance methods in generated documentation.


>---------------------------------------------------------------

88df578a8573908d665d4597c4c619c29055a277
 haddock-api/src/Haddock/Backends/Xhtml/Decl.hs   | 39 ++++++++++++++++--------
 haddock-api/src/Haddock/Backends/Xhtml/Layout.hs |  2 +-
 2 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index a9f38c1..abcf3ea 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -525,26 +525,39 @@ ppInstances links origin instances baseName splice unicode qual
   where
     instName = getOccString $ getName baseName
     instDecl :: Int -> DocInstance DocName -> (SubDecl,Located DocName)
-    instDecl no (inst, maybeDoc,l) =
-        ((ppInstHead links splice unicode qual origin no inst, maybeDoc, []),l)
+    instDecl no (inst, mdoc, loc) =
+        ((ppInstHead links splice unicode qual mdoc origin no inst), loc)
 
 
 ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification
-           -> InstOrigin -> Int -> InstHead DocName
-           -> Html
-ppInstHead links splice unicode qual origin no (InstHead {..}) =
+           -> Maybe (MDoc DocName) -> InstOrigin -> Int -> InstHead DocName
+           -> SubDecl
+ppInstHead links splice unicode qual mdoc origin no (InstHead {..}) =
     case ihdInstType of
         ClassInst { .. } ->
-            subClsInstance iid hdr mets
+            ( subInstHead iid $ ppContextNoLocs clsiCtx unicode qual <+> typ
+            , mdoc
+            , [subInstMethods iid sigs]
+            )
           where
-            hdr = ppContextNoLocs clsiCtx unicode qual <+> typ
-            mets = ppInstanceSigs links splice unicode qual
-                clsiTyVars ihdTypes clsiSigs
             iid = instanceId origin no ihdClsName
-        TypeInst rhs -> keyword "type" <+> typ
-            <+> maybe noHtml (\t -> equals <+> ppType unicode qual t) rhs
-        DataInst dd -> keyword "data" <+> typ
-            <+> ppShortDataDecl False True dd unicode qual
+            sigs = ppInstanceSigs links splice unicode qual
+                clsiTyVars ihdTypes clsiSigs
+        TypeInst rhs ->
+            (ptype, mdoc, [])
+          where
+            ptype = mconcat
+                [ keyword "type"
+                , typ
+                , maybe noHtml (\t -> equals <+> ppType unicode qual t) rhs
+                ]
+        DataInst dd ->
+            (pdata, mdoc, [])
+          where
+            pdata = mconcat
+                [ keyword "data" <+> typ
+                , ppShortDataDecl False True dd unicode qual
+                ]
   where
     typ = ppAppNameTypes ihdClsName ihdKinds ihdTypes unicode qual
 
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
index da03985..0b09e22 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
@@ -31,7 +31,7 @@ module Haddock.Backends.Xhtml.Layout (
   subConstructors,
   subEquations,
   subFields,
-  subInstances, subClsInstance,
+  subInstances, subClsInstance, subInstHead, subInstMethods,
   subMethods,
   subMinimal,
 



More information about the ghc-commits mailing list