diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2016-03-18 11:02:38 -0400 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2016-03-21 12:16:10 -0400 |
commit | 1701255c06fed2aa2811f7f29f108d88fc4d6f26 (patch) | |
tree | 2b9057eb1c4fb723553770bd058a1a921952bf83 /testsuite/tests/dependent | |
parent | 0706a103ae8c9c61e6bbaadd16b32da76aa5a749 (diff) | |
download | haskell-1701255c06fed2aa2811f7f29f108d88fc4d6f26.tar.gz |
Fix #11635 / #11719.
Instead of creating a new meta-tyvar and then unifying it with
a known kind in a KindedTyVar in a LHsQTyVars, just use the known kind.
Sadly, this still doesn't make #11719 usable, because while you can
now define a higher-kinded type family, you can't write any equations
for it, which is a larger problem.
test cases: dependent/should_compile/T{11635,11719}
Diffstat (limited to 'testsuite/tests/dependent')
-rw-r--r-- | testsuite/tests/dependent/should_compile/T11635.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/dependent/should_compile/T11719.hs | 18 | ||||
-rw-r--r-- | testsuite/tests/dependent/should_compile/all.T | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/dependent/should_compile/T11635.hs b/testsuite/tests/dependent/should_compile/T11635.hs new file mode 100644 index 0000000000..1cbdbafb90 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11635.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TypeInType, KindSignatures, ExplicitForAll #-} + +module T11635 where + +import Data.Kind + +data X (a :: forall k. k -> * ) b = X diff --git a/testsuite/tests/dependent/should_compile/T11719.hs b/testsuite/tests/dependent/should_compile/T11719.hs new file mode 100644 index 0000000000..ba4d7c9db4 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11719.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE RankNTypes, TypeFamilies, TypeInType, TypeOperators, + UndecidableInstances #-} + +module T11719 where + +import Data.Kind + +data TyFun :: * -> * -> * +type a ~> b = TyFun a b -> * + +type family (f :: a ~> b) @@ (x :: a) :: b + +data Null a = Nullable a | NotNullable a + +type family ((f :: b ~> c) ∘ (g :: a ~> b)) (x :: a) :: c where + (f ∘ g) x = f @@ (g @@ x) + +type family BaseType (k :: forall a. a ~> Type) (x :: b) :: Type where -- this fails :( diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 2f9d311f4f..5985fd9fbb 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -19,3 +19,5 @@ test('T11405', normal, compile, ['']) test('T11241', normal, compile, ['']) test('T11711', normal, compile, ['']) test('RaeJobTalk', normal, compile, ['']) +test('T11635', normal, compile, ['']) +test('T11719', normal, compile, ['']) |