aboutsummaryrefslogtreecommitdiff
path: root/html-test
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2019-02-03 22:58:58 -0800
committerGitHub <noreply@github.com>2019-02-03 22:58:58 -0800
commitaa9644fc4179de044557438f2bd3003642750a97 (patch)
treed2c0767d85a6be4c71f7c64c232c44ad4db0e15b /html-test
parenta0973d09a5b4f6a08b35c0b3de371c895d7d847a (diff)
Miscellaneous improvements to `Convert` (#1020)
Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms
Diffstat (limited to 'html-test')
-rw-r--r--html-test/ref/Bug548.html8
-rw-r--r--html-test/ref/Instances.html14
-rw-r--r--html-test/ref/Operators.html10
-rw-r--r--html-test/ref/PatternSyns.html42
-rw-r--r--html-test/ref/TypeFamilies.html40
5 files changed, 27 insertions, 87 deletions
diff --git a/html-test/ref/Bug548.html b/html-test/ref/Bug548.html
index cff64ca2..e040e603 100644
--- a/html-test/ref/Bug548.html
+++ b/html-test/ref/Bug548.html
@@ -148,7 +148,9 @@
><p class="src"
><a href="#"
>from1</a
- > :: <a href="#" title="Bug548"
+ > :: <span class="keyword"
+ >forall</span
+ > (a0 :: k). <a href="#" title="Bug548"
>WrappedArrow</a
> a b a0 -&gt; <a href="#" title="GHC.Generics"
>Rep1</a
@@ -160,7 +162,9 @@
><p class="src"
><a href="#"
>to1</a
- > :: <a href="#" title="GHC.Generics"
+ > :: <span class="keyword"
+ >forall</span
+ > (a0 :: k). <a href="#" title="GHC.Generics"
>Rep1</a
> (<a href="#" title="Bug548"
>WrappedArrow</a
diff --git a/html-test/ref/Instances.html b/html-test/ref/Instances.html
index 4f51f049..0cf0fc92 100644
--- a/html-test/ref/Instances.html
+++ b/html-test/ref/Instances.html
@@ -2038,8 +2038,6 @@
>Int</a
> c <a href="#" title="Data.Bool"
>Bool</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -2050,9 +2048,7 @@
>Thud</a
> <a href="#" title="Data.Int"
>Int</a
- > c :: <a href="#" title="Data.Kind"
- >Type</a
- > <a href="#" class="selflink"
+ > c <a href="#" class="selflink"
>#</a
></p
></div
@@ -2112,9 +2108,7 @@
>type</span
> <a href="#" title="Instances"
>Plugh</a
- > [a] c [b] :: <a href="#" title="Data.Kind"
- >Type</a
- > <a href="#" class="selflink"
+ > [a] c [b] <a href="#" class="selflink"
>#</a
></p
><p class="src"
@@ -2122,9 +2116,7 @@
>data</span
> <a href="#" title="Instances"
>Thud</a
- > [a] c :: <a href="#" title="Data.Kind"
- >Type</a
- > <a href="#" class="selflink"
+ > [a] c <a href="#" class="selflink"
>#</a
></p
></div
diff --git a/html-test/ref/Operators.html b/html-test/ref/Operators.html
index 8c7746af..d0c42a08 100644
--- a/html-test/ref/Operators.html
+++ b/html-test/ref/Operators.html
@@ -96,9 +96,7 @@
>pattern</span
> <a href="#"
>(:+)</a
- > :: <span class="keyword"
- >forall</span
- > a. a -&gt; a -&gt; [a]</li
+ > :: a -&gt; a -&gt; [a]</li
><li class="src short"
><span class="keyword"
>data</span
@@ -285,9 +283,7 @@
>pattern</span
> <a id="v::-43-" class="def"
>(:+)</a
- > :: <span class="keyword"
- >forall</span
- > a. a -&gt; a -&gt; [a] <span class="fixity"
+ > :: a -&gt; a -&gt; [a] <span class="fixity"
>infixr 3</span
><span class="rightedge"
></span
@@ -529,4 +525,4 @@
></div
></body
></html
->
+> \ No newline at end of file
diff --git a/html-test/ref/PatternSyns.html b/html-test/ref/PatternSyns.html
index af6d0210..6b4f8fda 100644
--- a/html-test/ref/PatternSyns.html
+++ b/html-test/ref/PatternSyns.html
@@ -68,9 +68,7 @@
>pattern</span
> <a href="#"
>Foo</a
- > :: <span class="keyword"
- >forall</span
- > x. x -&gt; <a href="#" title="PatternSyns"
+ > :: x -&gt; <a href="#" title="PatternSyns"
>FooType</a
> x</li
><li class="src short"
@@ -78,9 +76,7 @@
>pattern</span
> <a href="#"
>Bar</a
- > :: <span class="keyword"
- >forall</span
- > x. x -&gt; <a href="#" title="PatternSyns"
+ > :: x -&gt; <a href="#" title="PatternSyns"
>FooType</a
> (<a href="#" title="PatternSyns"
>FooType</a
@@ -90,9 +86,7 @@
>pattern</span
> <a href="#"
>(:&lt;-&gt;)</a
- > :: <span class="keyword"
- >forall</span
- > x x1. x -&gt; x1 -&gt; (<a href="#" title="PatternSyns"
+ > :: x -&gt; x1 -&gt; (<a href="#" title="PatternSyns"
>FooType</a
> x, <a href="#" title="PatternSyns"
>FooType</a
@@ -114,9 +108,7 @@
>pattern</span
> <a href="#"
>Blub</a
- > :: () =&gt; <span class="keyword"
- >forall</span
- > x. <a href="#" title="Text.Show"
+ > :: () =&gt; <a href="#" title="Text.Show"
>Show</a
> x =&gt; x -&gt; <a href="#" title="PatternSyns"
>BlubType</a
@@ -134,9 +126,7 @@
>pattern</span
> <a href="#"
>E</a
- > :: <span class="keyword"
- >forall</span
- > k a (b :: k). a <a href="#" title="PatternSyns"
+ > :: a <a href="#" title="PatternSyns"
>&gt;&lt;</a
> b</li
><li class="src short"
@@ -189,9 +179,7 @@
>pattern</span
> <a id="v:Foo" class="def"
>Foo</a
- > :: <span class="keyword"
- >forall</span
- > x. x -&gt; <a href="#" title="PatternSyns"
+ > :: x -&gt; <a href="#" title="PatternSyns"
>FooType</a
> x <a href="#" class="selflink"
>#</a
@@ -211,9 +199,7 @@
>pattern</span
> <a id="v:Bar" class="def"
>Bar</a
- > :: <span class="keyword"
- >forall</span
- > x. x -&gt; <a href="#" title="PatternSyns"
+ > :: x -&gt; <a href="#" title="PatternSyns"
>FooType</a
> (<a href="#" title="PatternSyns"
>FooType</a
@@ -235,9 +221,7 @@
>pattern</span
> <a id="v::-60--45--62-" class="def"
>(:&lt;-&gt;)</a
- > :: <span class="keyword"
- >forall</span
- > x x1. x -&gt; x1 -&gt; (<a href="#" title="PatternSyns"
+ > :: x -&gt; x1 -&gt; (<a href="#" title="PatternSyns"
>FooType</a
> x, <a href="#" title="PatternSyns"
>FooType</a
@@ -291,9 +275,7 @@
>pattern</span
> <a id="v:Blub" class="def"
>Blub</a
- > :: () =&gt; <span class="keyword"
- >forall</span
- > x. <a href="#" title="Text.Show"
+ > :: () =&gt; <a href="#" title="Text.Show"
>Show</a
> x =&gt; x -&gt; <a href="#" title="PatternSyns"
>BlubType</a
@@ -347,9 +329,7 @@
>pattern</span
> <a id="v:E" class="def"
>E</a
- > :: <span class="keyword"
- >forall</span
- > k a (b :: k). a <a href="#" title="PatternSyns"
+ > :: a <a href="#" title="PatternSyns"
>&gt;&lt;</a
> b <a href="#" class="selflink"
>#</a
@@ -388,4 +368,4 @@
></div
></body
></html
->
+> \ No newline at end of file
diff --git a/html-test/ref/TypeFamilies.html b/html-test/ref/TypeFamilies.html
index 492b7ec1..8e1e7364 100644
--- a/html-test/ref/TypeFamilies.html
+++ b/html-test/ref/TypeFamilies.html
@@ -286,8 +286,6 @@
>AssocD</a
> <a href="#" title="TypeFamilies"
>X</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -298,8 +296,6 @@
>AssocT</a
> <a href="#" title="TypeFamilies"
>X</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -720,8 +716,6 @@
>AssocD</a
> <a href="#" title="TypeFamilies"
>Y</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -732,8 +726,6 @@
>AssocT</a
> <a href="#" title="TypeFamilies"
>Y</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -1107,11 +1099,7 @@
><li class="inst"
><a id="v:BatZ1" class="def"
>BatZ1</a
- > :: <span class="keyword"
- >forall</span
- > (z :: <a href="#" title="TypeFamilies"
- >Z</a
- >). <a href="#" title="TypeFamilies"
+ > :: <a href="#" title="TypeFamilies"
>Z</a
> -&gt; <a href="#" title="TypeFamilies"
>Bat</a
@@ -1121,11 +1109,7 @@
><li class="inst"
><a id="v:BatZ2" class="def"
>BatZ2</a
- > :: <span class="keyword"
- >forall</span
- > (z :: <a href="#" title="TypeFamilies"
- >Z</a
- >). {..} -&gt; <a href="#" title="TypeFamilies"
+ > :: {..} -&gt; <a href="#" title="TypeFamilies"
>Bat</a
> '<a href="#" title="TypeFamilies"
>ZB</a
@@ -1393,11 +1377,7 @@
><li class="inst"
><a id="v:BatZ1" class="def"
>BatZ1</a
- > :: <span class="keyword"
- >forall</span
- > (z :: <a href="#" title="TypeFamilies"
- >Z</a
- >). <a href="#" title="TypeFamilies"
+ > :: <a href="#" title="TypeFamilies"
>Z</a
> -&gt; <a href="#" title="TypeFamilies"
>Bat</a
@@ -1407,11 +1387,7 @@
><li class="inst"
><a id="v:BatZ2" class="def"
>BatZ2</a
- > :: <span class="keyword"
- >forall</span
- > (z :: <a href="#" title="TypeFamilies"
- >Z</a
- >). {..} -&gt; <a href="#" title="TypeFamilies"
+ > :: {..} -&gt; <a href="#" title="TypeFamilies"
>Bat</a
> '<a href="#" title="TypeFamilies"
>ZB</a
@@ -1620,8 +1596,6 @@
>AssocD</a
> <a href="#" title="TypeFamilies"
>Y</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -1632,8 +1606,6 @@
>AssocT</a
> <a href="#" title="TypeFamilies"
>Y</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -1678,8 +1650,6 @@
>AssocD</a
> <a href="#" title="TypeFamilies"
>X</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p
@@ -1690,8 +1660,6 @@
>AssocT</a
> <a href="#" title="TypeFamilies"
>X</a
- > :: <a href="#" title="Data.Kind"
- >Type</a
> <a href="#" class="selflink"
>#</a
></p