aboutsummaryrefslogtreecommitdiff
path: root/html-test
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-11-25 10:32:22 -0800
committerAlec Theriault <alec.theriault@gmail.com>2018-11-26 11:11:28 -0800
commita36ab92b289b4d6b707696eef49145bc7ced4957 (patch)
treea640a73c0f04132f60ac6ba39645521341866407 /html-test
parent8c785e2c46d3e37d14ab7888d96005ea2c69f37f (diff)
More uniform handling of `forall`'s in HTML/LaTeX
* don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes #973
Diffstat (limited to 'html-test')
-rw-r--r--html-test/ref/Bug973.html174
-rw-r--r--html-test/ref/FunArgs.html20
-rw-r--r--html-test/ref/PatternSyns.html4
-rw-r--r--html-test/ref/Test.html8
-rw-r--r--html-test/src/Bug975.hs15
5 files changed, 209 insertions, 12 deletions
diff --git a/html-test/ref/Bug973.html b/html-test/ref/Bug973.html
new file mode 100644
index 00000000..97d35758
--- /dev/null
+++ b/html-test/ref/Bug973.html
@@ -0,0 +1,174 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><meta name="viewport" content="width=device-width, initial-scale=1"
+ /><title
+ >Bug973</title
+ ><link href="#" rel="stylesheet" type="text/css" title="Linuwial"
+ /><link rel="stylesheet" type="text/css" href="#"
+ /><link rel="stylesheet" type="text/css" href="#"
+ /><script src="haddock-bundle.min.js" async="async" type="text/javascript"
+ ></script
+ ><script type="text/x-mathjax-config"
+ >MathJax.Hub.Config({ tex2jax: { processClass: &quot;mathjax&quot;, ignoreClass: &quot;.*&quot; } });</script
+ ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"
+ ></script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><span class="caption empty"
+ ></span
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href="#"
+ >Contents</a
+ ></li
+ ><li
+ ><a href="#"
+ >Index</a
+ ></li
+ ></ul
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >Safe</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >Bug973</p
+ ></div
+ ><div id="synopsis"
+ ><details id="syn"
+ ><summary
+ >Synopsis</summary
+ ><ul class="details-toggle" data-details-id="syn"
+ ><li class="src short"
+ ><a href="#"
+ >showRead</a
+ > :: <span class="keyword"
+ >forall</span
+ > a b. (<a href="#" title="Text.Show"
+ >Show</a
+ > a, <a href="#" title="Text.Read"
+ >Read</a
+ > b) =&gt; a -&gt; b</li
+ ><li class="src short"
+ ><a href="#"
+ >showRead'</a
+ > :: <span class="keyword"
+ >forall</span
+ > b a. (<a href="#" title="Text.Show"
+ >Show</a
+ > a, <a href="#" title="Text.Read"
+ >Read</a
+ > b) =&gt; a -&gt; b</li
+ ></ul
+ ></details
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><a id="v:showRead" class="def"
+ >showRead</a
+ > <a href="#" class="selflink"
+ >#</a
+ ></p
+ ><div class="subs arguments"
+ ><p class="caption"
+ >Arguments</p
+ ><table
+ ><tr
+ ><td class="src"
+ >:: <span class="keyword"
+ >forall</span
+ > a b. (<a href="#" title="Text.Show"
+ >Show</a
+ > a, <a href="#" title="Text.Read"
+ >Read</a
+ > b)</td
+ ><td class="doc empty"
+ ></td
+ ></tr
+ ><tr
+ ><td class="src"
+ >=&gt; a</td
+ ><td class="doc"
+ ><p
+ >this gets turned into a string...</p
+ ></td
+ ></tr
+ ><tr
+ ><td class="src"
+ >-&gt; b</td
+ ><td class="doc"
+ ><p
+ >...from which this is read</p
+ ></td
+ ></tr
+ ></table
+ ></div
+ ></div
+ ><div class="top"
+ ><p class="src"
+ ><a id="v:showRead-39-" class="def"
+ >showRead'</a
+ > <a href="#" class="selflink"
+ >#</a
+ ></p
+ ><div class="subs arguments"
+ ><p class="caption"
+ >Arguments</p
+ ><table
+ ><tr
+ ><td class="src"
+ >:: <span class="keyword"
+ >forall</span
+ > b a. (<a href="#" title="Text.Show"
+ >Show</a
+ > a, <a href="#" title="Text.Read"
+ >Read</a
+ > b)</td
+ ><td class="doc empty"
+ ></td
+ ></tr
+ ><tr
+ ><td class="src"
+ >=&gt; a</td
+ ><td class="doc"
+ ><p
+ >this gets turned into a string...</p
+ ></td
+ ></tr
+ ><tr
+ ><td class="src"
+ >-&gt; b</td
+ ><td class="doc"
+ ><p
+ >...from which this is read</p
+ ></td
+ ></tr
+ ></table
+ ></div
+ ><div class="doc"
+ ><p
+ >Same as <code
+ ><a href="#" title="Bug973"
+ >showRead</a
+ ></code
+ >, but with type variable order flipped</p
+ ></div
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ></div
+ ></body
+ ></html
+> \ No newline at end of file
diff --git a/html-test/ref/FunArgs.html b/html-test/ref/FunArgs.html
index bb54fa27..b40aa97c 100644
--- a/html-test/ref/FunArgs.html
+++ b/html-test/ref/FunArgs.html
@@ -58,7 +58,9 @@
><table
><tr
><td class="src"
- >:: <a href="#" title="Data.Ord"
+ >:: <span class="keyword"
+ >forall</span
+ > a. <a href="#" title="Data.Ord"
>Ord</a
> a</td
><td class="doc empty"
@@ -170,7 +172,9 @@
><table
><tr
><td class="src"
- >:: a</td
+ >:: <span class="keyword"
+ >forall</span
+ > a b c. a</td
><td class="doc"
><p
>First argument</p
@@ -194,7 +198,9 @@
></tr
><tr
><td class="src"
- >-&gt; d</td
+ >-&gt; <span class="keyword"
+ >forall</span
+ > d. d</td
><td class="doc"
><p
>Result</p
@@ -218,7 +224,7 @@
><td class="src"
>:: <span class="keyword"
>forall</span
- > (b :: ()). d ~ <a href="#" title="GHC.Tuple"
+ > a (b :: ()) d. d ~ <a href="#" title="GHC.Tuple"
>()</a
></td
><td class="doc empty"
@@ -226,7 +232,9 @@
></tr
><tr
><td class="src"
- >=&gt; a b c d</td
+ >=&gt; <span class="keyword"
+ >forall</span
+ > c. a b c d</td
><td class="doc"
><p
>abcd</p
@@ -258,7 +266,7 @@
><td class="src"
>:: <span class="keyword"
>forall</span
- > (a :: ()). proxy a</td
+ > proxy (a :: ()) b. proxy a</td
><td class="doc"
><p
>First argument</p
diff --git a/html-test/ref/PatternSyns.html b/html-test/ref/PatternSyns.html
index a002ca32..bae4b0bd 100644
--- a/html-test/ref/PatternSyns.html
+++ b/html-test/ref/PatternSyns.html
@@ -106,7 +106,7 @@
>BlubType</a
> = <a href="#" title="Text.Show"
>Show</a
- > x =&gt; <a href="#"
+ > x =&gt; <a href="#"
>BlubCtor</a
> x</li
><li class="src short"
@@ -276,7 +276,7 @@
><td class="src"
><a href="#" title="Text.Show"
>Show</a
- > x =&gt; <a id="v:BlubCtor" class="def"
+ > x =&gt; <a id="v:BlubCtor" class="def"
>BlubCtor</a
> x</td
><td class="doc empty"
diff --git a/html-test/ref/Test.html b/html-test/ref/Test.html
index 481f5d62..b8d7f251 100644
--- a/html-test/ref/Test.html
+++ b/html-test/ref/Test.html
@@ -581,7 +581,7 @@
><li
>= <a href="#" title="Test"
>C</a
- > b =&gt; <a href="#"
+ > b =&gt; <a href="#"
>Ex1</a
> b</li
><li
@@ -591,7 +591,7 @@
><li
>| <a href="#" title="Test"
>C</a
- > a =&gt; <a href="#"
+ > a =&gt; <a href="#"
>Ex3</a
> b</li
><li
@@ -2071,7 +2071,7 @@ is at the beginning of the line).</pre
><td class="src"
><a href="#" title="Test"
>C</a
- > b =&gt; <a id="v:Ex1" class="def"
+ > b =&gt; <a id="v:Ex1" class="def"
>Ex1</a
> b</td
><td class="doc empty"
@@ -2089,7 +2089,7 @@ is at the beginning of the line).</pre
><td class="src"
><a href="#" title="Test"
>C</a
- > a =&gt; <a id="v:Ex3" class="def"
+ > a =&gt; <a id="v:Ex3" class="def"
>Ex3</a
> b</td
><td class="doc empty"
diff --git a/html-test/src/Bug975.hs b/html-test/src/Bug975.hs
new file mode 100644
index 00000000..97ebabda
--- /dev/null
+++ b/html-test/src/Bug975.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE ExplicitForAll #-}
+module Bug973 where
+
+showRead
+ :: forall a b. (Show a, Read b)
+ => a -- ^ this gets turned into a string...
+ -> b -- ^ ...from which this is read
+showRead = read . show
+
+-- | Same as 'showRead', but with type variable order flipped
+showRead'
+ :: forall b a. (Show a, Read b)
+ => a -- ^ this gets turned into a string...
+ -> b -- ^ ...from which this is read
+showRead' = read . show