diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-10-23 09:42:20 -0400 |
---|---|---|
committer | Alec Theriault <alec.theriault@gmail.com> | 2019-10-23 10:37:17 -0400 |
commit | 2a5fc0ad50c857098558461434c29abd478ea0a1 (patch) | |
tree | 0c1b0312461b6e23380e73d5187747d50970cb8f /html-test | |
parent | cdf4445a877428f5969f712a95830af38029b9a0 (diff) |
Reify oversaturated data family instances correctly (#1103)
This fixes #1103 by adapting the corresponding patch for GHC (see
https://gitlab.haskell.org/ghc/ghc/issues/17296 and
https://gitlab.haskell.org/ghc/ghc/merge_requests/1877).
Diffstat (limited to 'html-test')
-rw-r--r-- | html-test/ref/Bug1103.html | 556 | ||||
-rw-r--r-- | html-test/src/Bug1103.hs | 24 |
2 files changed, 580 insertions, 0 deletions
diff --git a/html-test/ref/Bug1103.html b/html-test/ref/Bug1103.html new file mode 100644 index 00000000..cc16017b --- /dev/null +++ b/html-test/ref/Bug1103.html @@ -0,0 +1,556 @@ +<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 + >Bug1103</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: "mathjax", ignoreClass: ".*" } });</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" + >Bug1103</p + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data family</span + > <a id="t:Foo1" class="def" + >Foo1</a + > :: <a href="#" title="Data.Kind" + >Type</a + > -> <a href="#" title="Data.Kind" + >Type</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Foo1" + >Instances</h4 + ><details id="i:Foo1" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo1:Foo1:1" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > <a href="#" title="Data.Bool" + >Bool</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo1:Foo1:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > <a href="#" title="Data.Bool" + >Bool</a + > = <a id="v:Foo1Bool" class="def" + >Foo1Bool</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo1:Foo1:2" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo1:Foo1:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a)</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data family</span + > <a id="t:Foo2" class="def" + >Foo2</a + > :: k -> <a href="#" title="Data.Kind" + >Type</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Foo2" + >Instances</h4 + ><details id="i:Foo2" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:1" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:2" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > <a href="#" title="Data.Bool" + >Bool</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > <a href="#" title="Data.Bool" + >Bool</a + > = <a id="v:Foo2Bool" class="def" + >Foo2Bool</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:3" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:3" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:4" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:4" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data family</span + > <a id="t:Foo3" class="def" + >Foo3</a + > :: k <a href="#" class="selflink" + >#</a + ></p + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Foo3" + >Instances</h4 + ><details id="i:Foo3" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:1" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:2" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:3" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:3" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:4" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > <a href="#" title="Data.Bool" + >Bool</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:4" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > <a href="#" title="Data.Bool" + >Bool</a + > = <a id="v:Foo3Bool" class="def" + >Foo3Bool</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:5" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:5" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ></div + ></div + ><div id="footer" + ></div + ></body + ></html +>
\ No newline at end of file diff --git a/html-test/src/Bug1103.hs b/html-test/src/Bug1103.hs new file mode 100644 index 00000000..1f387e62 --- /dev/null +++ b/html-test/src/Bug1103.hs @@ -0,0 +1,24 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +module Bug1103 where + +import Data.Kind + +data family Foo1 :: Type -> Type +data instance Foo1 Bool = Foo1Bool +data instance Foo1 (Maybe a) + +data family Foo2 :: k -> Type +data instance Foo2 Bool = Foo2Bool +data instance Foo2 (Maybe a) +data instance Foo2 :: Char -> Type +data instance Foo2 :: (Char -> Char) -> Type where + +data family Foo3 :: k +data instance Foo3 +data instance Foo3 Bool = Foo3Bool +data instance Foo3 (Maybe a) +data instance Foo3 :: Char -> Type +data instance Foo3 :: (Char -> Char) -> Type where |