Commit 230b013b authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #9569

parent e6391208
{-# LANGUAGE RankNTypes, ConstraintKinds, KindSignatures, DataKinds, TypeFamilies #-}
module T9569 where
import GHC.Prim
data Proxy (c :: Constraint)
class Deferrable (c :: Constraint) where
defer :: Proxy c -> (c => a) -> a
deferPair :: (Deferrable c1, Deferrable c2) =>
Proxy (c1,c2) -> ((c1,c2) => a) -> a
deferPair = undefined
instance (Deferrable c1, Deferrable c2) => Deferrable (c1,c2) where
-- defer p f = deferPair p f -- Succeeds
defer = deferPair -- Fails
{-
[G] Deferrable c1, Deferrable c2
[W] Proxy (c1,c2) -> ((c1,c2) => a) -> a ~ Proxy (c1x,c2x) -> ((c1x,c2x) => ax) -> ax
[w] Deferrable c1x
[w] Deferrable c2x
-}
\ No newline at end of file
...@@ -109,3 +109,4 @@ test('T9063', normal, compile, ['']) ...@@ -109,3 +109,4 @@ test('T9063', normal, compile, [''])
test('T9200', normal, compile, ['']) test('T9200', normal, compile, [''])
test('T9200b', normal, compile_fail, ['']) test('T9200b', normal, compile_fail, [''])
test('T9750', normal, compile, ['']) test('T9750', normal, compile, [''])
test('T9569', normal, compile, [''])
{-# LANGUAGE RankNTypes #-}
module T9569a where
g :: (Int -> Int) -> Int
g f = f 4
f1 :: (forall a. a -> a) -> Int
f1 = g
f2 :: (forall a. a -> a) -> Int
f2 x = g x
...@@ -419,6 +419,7 @@ test('T8644', normal, compile, ['']) ...@@ -419,6 +419,7 @@ test('T8644', normal, compile, [''])
test('T8762', normal, compile, ['']) test('T8762', normal, compile, [''])
test('MutRec', normal, compile, ['']) test('MutRec', normal, compile, [''])
test('T8856', normal, compile, ['']) test('T8856', normal, compile, [''])
test('T9569a', normal, compile, [''])
test('T9117', normal, compile, ['']) test('T9117', normal, compile, [''])
test('T9117_2', expect_broken('9117'), compile, ['']) test('T9117_2', expect_broken('9117'), compile, [''])
test('T9708', normal, compile_fail, ['']) test('T9708', normal, compile_fail, [''])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment