summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T7332.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/polykinds/T7332.hs')
-rw-r--r--testsuite/tests/polykinds/T7332.hs20
1 files changed, 18 insertions, 2 deletions
diff --git a/testsuite/tests/polykinds/T7332.hs b/testsuite/tests/polykinds/T7332.hs
index 647dd9333d..79623e9803 100644
--- a/testsuite/tests/polykinds/T7332.hs
+++ b/testsuite/tests/polykinds/T7332.hs
@@ -18,7 +18,7 @@ instance IsString (DC String) where
class Monoid acc => Build acc r where
- type BuildR r :: * -- Result type
+ type BuildR r :: * -- Result type
build :: (acc -> BuildR r) -> acc -> r
instance Monoid dc => Build dc (DC dx) where
@@ -31,9 +31,25 @@ instance (Build dc r, a ~ dc) => Build dc (a->r) where
-- The type is inferred
-tspan :: (Monoid d, Build (DC d) r, BuildR r ~ DC d) => r
+-- tspan :: (Monoid d, Build (DC d) r, BuildR r ~ DC d) => r
+tspan :: (Build (DC d) r, BuildR r ~ DC d) => r
tspan = build (id :: DC d -> DC d) mempty
+{- Wanted:
+ Build acc0 r0
+ Monid acc0
+ acc0 ~ DC d0
+ DC d0 ~ BuildR r0
+==>
+ Build (DC d0) r0
+ Monoid (DC d0) --> Monoid d0
+ DC d- ~ BuildR r0
+
+In fact Monoid (DC d0) is a superclass of (Build (DC do) r0)
+But during inference we do not take upserclasses of wanteds
+-}
+
+
foo = tspan "aa"
foo1 = tspan (tspan "aa")