aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-05-23 02:29:05 -0700
committerSimon Jakobi <simon.jakobi@gmail.com>2018-06-13 23:39:30 +0200
commit622c45d56e0ccb11e3b8b0832654cb30c8369ba8 (patch)
tree851b0d37012728950d7331d391d28c4a7bfd0a96
parentd1b26b4846f10fc3e0f84f6898852a6605a3e286 (diff)
Use `ClassOpSig` instead of `TypeSig` for class methods (#835)
* Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix #834. * Accept html-test output
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs8
-rw-r--r--html-test/ref/Bug26.html14
-rw-r--r--html-test/ref/Bug613.html14
-rw-r--r--html-test/ref/Bug647.html8
-rw-r--r--html-test/ref/Bug679.html8
-rw-r--r--html-test/ref/DeprecatedClass.html28
-rw-r--r--html-test/ref/Hash.html16
-rw-r--r--html-test/ref/Instances.html24
-rw-r--r--html-test/ref/Minimal.html36
-rw-r--r--html-test/ref/Operators.html34
-rw-r--r--html-test/ref/OrphanInstancesClass.html8
-rw-r--r--html-test/ref/Test.html58
-rw-r--r--html-test/ref/Ticket61.html8
13 files changed, 124 insertions, 140 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index d4f6db0e..819c9aa6 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -523,9 +523,9 @@ ppShortClassDecl summary links (ClassDecl { tcdCtxt = lctxt, tcdLName = lname, t
-- ToDo: add associated type defaults
- [ ppFunSig summary links loc doc names (hsSigWcType typ)
+ [ ppFunSig summary links loc doc names (hsSigType typ)
[] splice unicode pkg qual
- | L _ (TypeSig _ lnames typ) <- sigs
+ | L _ (ClassOpSig _ False lnames typ) <- sigs
, let doc = lookupAnySubdoc (head names) subdocs
names = map unLoc lnames ]
-- FIXME: is taking just the first name ok? Is it possible that
@@ -585,12 +585,12 @@ ppClassDecl summary links instances fixities loc d subdocs
minimalBit = case [ s | MinimalSig _ _ (L _ s) <- sigs ] of
-- Miminal complete definition = every shown method
And xs : _ | sort [getName n | L _ (Var (L _ n)) <- xs] ==
- sort [getName n | TypeSig _ ns _ <- sigs, L _ n <- ns]
+ sort [getName n | ClassOpSig _ _ ns _ <- sigs, L _ n <- ns]
-> noHtml
-- Minimal complete definition = the only shown method
Var (L _ n) : _ | [getName n] ==
- [getName n' | L _ (TypeSig _ ns _) <- lsigs, L _ n' <- ns]
+ [getName n' | L _ (ClassOpSig _ _ ns _) <- lsigs, L _ n' <- ns]
-> noHtml
-- Minimal complete definition = nothing
diff --git a/html-test/ref/Bug26.html b/html-test/ref/Bug26.html
index e50169ba..a363fef3 100644
--- a/html-test/ref/Bug26.html
+++ b/html-test/ref/Bug26.html
@@ -71,7 +71,11 @@
> a <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >c_f</a
+ > :: a</li
+ ></ul
></li
></ul
></details
@@ -126,14 +130,6 @@
>Since: 1.0</em
></p
></div
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Bug26"
- >c_f</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Bug613.html b/html-test/ref/Bug613.html
index 12717922..71e30832 100644
--- a/html-test/ref/Bug613.html
+++ b/html-test/ref/Bug613.html
@@ -51,7 +51,11 @@
> f <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >fmap</a
+ > :: (a -&gt; b) -&gt; f a -&gt; f b</li
+ ></ul
></li
><li class="src short"
><span class="keyword"
@@ -78,14 +82,6 @@
> <a href="#" class="selflink"
>#</a
></p
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Bug613"
- >fmap</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Bug647.html b/html-test/ref/Bug647.html
index 3375546d..0928c1ec 100644
--- a/html-test/ref/Bug647.html
+++ b/html-test/ref/Bug647.html
@@ -52,14 +52,6 @@
> <a href="#" class="selflink"
>#</a
></p
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Bug647"
- >f</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Bug679.html b/html-test/ref/Bug679.html
index 093c9046..71eb9360 100644
--- a/html-test/ref/Bug679.html
+++ b/html-test/ref/Bug679.html
@@ -126,14 +126,6 @@
> <a href="#" class="selflink"
>#</a
></p
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Bug679"
- >foo</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/DeprecatedClass.html b/html-test/ref/DeprecatedClass.html
index fc78c987..55abc489 100644
--- a/html-test/ref/DeprecatedClass.html
+++ b/html-test/ref/DeprecatedClass.html
@@ -51,7 +51,11 @@
> a <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >foo</a
+ > :: a -&gt; a</li
+ ></ul
></li
><li class="src short"
><span class="keyword"
@@ -61,7 +65,11 @@
> a <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >bar</a
+ > :: a -&gt; a</li
+ ></ul
></li
></ul
></details
@@ -88,14 +96,6 @@
><p
>some class</p
></div
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="DeprecatedClass"
- >foo</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -132,14 +132,6 @@
>Deprecated: SomeOtherClass</p
></div
></div
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="DeprecatedClass"
- >bar</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Hash.html b/html-test/ref/Hash.html
index 8c48cee4..517428fa 100644
--- a/html-test/ref/Hash.html
+++ b/html-test/ref/Hash.html
@@ -126,7 +126,13 @@
> a <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >hash</a
+ > :: a -&gt; <a href="#" title="Data.Int"
+ >Int</a
+ ></li
+ ></ul
></li
></ul
></details
@@ -259,14 +265,6 @@
><p
>A class of types which can be hashed.</p
></div
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Hash"
- >hash</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Instances.html b/html-test/ref/Instances.html
index 3dc26133..1b4f276f 100644
--- a/html-test/ref/Instances.html
+++ b/html-test/ref/Instances.html
@@ -146,6 +146,12 @@
> <a href="#" class="selflink"
>#</a
></p
+ ><div class="subs minimal"
+ ><p class="caption"
+ >Minimal complete definition</p
+ ><p class="src"
+ >Nothing</p
+ ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -642,6 +648,12 @@
> <a href="#" class="selflink"
>#</a
></p
+ ><div class="subs minimal"
+ ><p class="caption"
+ >Minimal complete definition</p
+ ><p class="src"
+ >Nothing</p
+ ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -1196,6 +1208,12 @@
> <a href="#" class="selflink"
>#</a
></p
+ ><div class="subs minimal"
+ ><p class="caption"
+ >Minimal complete definition</p
+ ><p class="src"
+ >Nothing</p
+ ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -1922,6 +1940,12 @@
> <a href="#" class="selflink"
>#</a
></p
+ ><div class="subs minimal"
+ ><p class="caption"
+ >Minimal complete definition</p
+ ><p class="src"
+ >Nothing</p
+ ></div
><div class="subs associated-types"
><p class="caption"
>Associated Types</p
diff --git a/html-test/ref/Minimal.html b/html-test/ref/Minimal.html
index 5fe252ba..bc2da115 100644
--- a/html-test/ref/Minimal.html
+++ b/html-test/ref/Minimal.html
@@ -128,6 +128,26 @@
> <a href="#" class="selflink"
>#</a
></p
+ ><div class="subs minimal"
+ ><p class="caption"
+ >Minimal complete definition</p
+ ><p class="src"
+ >(<a href="#" title="Minimal"
+ >a</a
+ >, <a href="#" title="Minimal"
+ >b</a
+ >, <a href="#" title="Minimal"
+ >c</a
+ > | (<a href="#" title="Minimal"
+ >d</a
+ > | <a href="#" title="Minimal"
+ >e</a
+ >, (<a href="#" title="Minimal"
+ >f</a
+ > | <a href="#" title="Minimal"
+ >g</a
+ >)))</p
+ ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -230,16 +250,6 @@
> <a href="#" class="selflink"
>#</a
></p
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Minimal"
- >aaa</a
- >, <a href="#" title="Minimal"
- >bbb</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -298,6 +308,12 @@
> <a href="#" class="selflink"
>#</a
></p
+ ><div class="subs minimal"
+ ><p class="caption"
+ >Minimal complete definition</p
+ ><p class="src"
+ >Nothing</p
+ ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Operators.html b/html-test/ref/Operators.html
index 075affab..26b7e7f0 100644
--- a/html-test/ref/Operators.html
+++ b/html-test/ref/Operators.html
@@ -145,6 +145,22 @@
> a <a href="#"
>&gt;&lt;&lt;</a
> b</li
+ ><li
+ ><a href="#"
+ >(&gt;&gt;&lt;)</a
+ >, <a href="#"
+ >(&lt;&lt;&gt;)</a
+ > :: a -&gt; b -&gt; ()</li
+ ><li
+ ><a href="#"
+ >(**&gt;)</a
+ >, <a href="#"
+ >(**&lt;)</a
+ >, <a href="#"
+ >(&gt;**)</a
+ >, <a href="#"
+ >(&lt;**)</a
+ > :: a -&gt; a -&gt; ()</li
></ul
></li
><li class="src short"
@@ -376,24 +392,6 @@
><p
>Class with fixity, including associated types</p
></div
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Operators"
- >(&gt;&gt;&lt;)</a
- >, <a href="#" title="Operators"
- >(&lt;&lt;&gt;)</a
- >, <a href="#" title="Operators"
- >(**&gt;)</a
- >, <a href="#" title="Operators"
- >(**&lt;)</a
- >, <a href="#" title="Operators"
- >(&gt;**)</a
- >, <a href="#" title="Operators"
- >(&lt;**)</a
- ></p
- ></div
><div class="subs associated-types"
><p class="caption"
>Associated Types</p
diff --git a/html-test/ref/OrphanInstancesClass.html b/html-test/ref/OrphanInstancesClass.html
index 7b7085ea..81651e18 100644
--- a/html-test/ref/OrphanInstancesClass.html
+++ b/html-test/ref/OrphanInstancesClass.html
@@ -52,14 +52,6 @@
> <a href="#" class="selflink"
>#</a
></p
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="OrphanInstancesClass"
- >aClass</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Test.html b/html-test/ref/Test.html
index 369541f3..26481afe 100644
--- a/html-test/ref/Test.html
+++ b/html-test/ref/Test.html
@@ -478,7 +478,17 @@
> a <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >a</a
+ > :: <a href="#" title="System.IO"
+ >IO</a
+ > a</li
+ ><li
+ ><a href="#"
+ >b</a
+ > :: [a]</li
+ ></ul
></li
><li class="src short"
><span class="keyword"
@@ -488,7 +498,17 @@
> a <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >d</a
+ > :: <a href="#" title="Test"
+ >T</a
+ > a b</li
+ ><li
+ ><a href="#"
+ >e</a
+ > :: (a, a)</li
+ ></ul
></li
><li class="src short"
><span class="keyword"
@@ -504,7 +524,11 @@
> a <span class="keyword"
>where</span
><ul class="subs"
- ></ul
+ ><li
+ ><a href="#"
+ >ff</a
+ > :: a</li
+ ></ul
></li
><li class="src short"
><a href="#"
@@ -1558,16 +1582,6 @@
></code
> class)</p
></div
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Test"
- >a</a
- >, <a href="#" title="Test"
- >b</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -1618,16 +1632,6 @@
><p
>This is a class declaration with no separate docs for the methods</p
></div
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Test"
- >d</a
- >, <a href="#" title="Test"
- >e</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
@@ -1790,14 +1794,6 @@
> <a href="#" class="selflink"
>#</a
></p
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Test"
- >ff</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p
diff --git a/html-test/ref/Ticket61.html b/html-test/ref/Ticket61.html
index e70ee3bd..9cab5271 100644
--- a/html-test/ref/Ticket61.html
+++ b/html-test/ref/Ticket61.html
@@ -52,14 +52,6 @@
> <a href="#" class="selflink"
>#</a
></p
- ><div class="subs minimal"
- ><p class="caption"
- >Minimal complete definition</p
- ><p class="src"
- ><a href="#" title="Ticket61"
- >f</a
- ></p
- ></div
><div class="subs methods"
><p class="caption"
>Methods</p