summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_run
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2018-06-14 15:02:36 -0400
committerRichard Eisenberg <rae@cs.brynmawr.edu>2018-06-14 15:05:32 -0400
commitd650729f9a0f3b6aa5e6ef2d5fba337f6f70fa60 (patch)
treeac224609397d4b7ca7072fc87739d2522be7675b /testsuite/tests/simplCore/should_run
parent4672e2ebf040feffde4e7e2d79c479e4c0c3efaf (diff)
downloadhaskell-d650729f9a0f3b6aa5e6ef2d5fba337f6f70fa60.tar.gz
Embrace -XTypeInType, add -XStarIsType
Summary: Implement the "Embrace Type :: Type" GHC proposal, .../ghc-proposals/blob/master/proposals/0020-no-type-in-type.rst GHC 8.0 included a major change to GHC's type system: the Type :: Type axiom. Though casual users were protected from this by hiding its features behind the -XTypeInType extension, all programs written in GHC 8+ have the axiom behind the scenes. In order to preserve backward compatibility, various legacy features were left unchanged. For example, with -XDataKinds but not -XTypeInType, GADTs could not be used in types. Now these restrictions are lifted and -XTypeInType becomes a redundant flag that will be eventually deprecated. * Incorporate the features currently in -XTypeInType into the -XPolyKinds and -XDataKinds extensions. * Introduce a new extension -XStarIsType to control how to parse * in code and whether to print it in error messages. Test Plan: Validate Reviewers: goldfire, hvr, bgamari, alanz, simonpj Reviewed By: goldfire, simonpj Subscribers: rwbarton, thomie, mpickering, carter GHC Trac Issues: #15195 Differential Revision: https://phabricator.haskell.org/D4748
Diffstat (limited to 'testsuite/tests/simplCore/should_run')
-rw-r--r--testsuite/tests/simplCore/should_run/T13750a.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/testsuite/tests/simplCore/should_run/T13750a.hs b/testsuite/tests/simplCore/should_run/T13750a.hs
index 7ed72ca241..ac3806e7f9 100644
--- a/testsuite/tests/simplCore/should_run/T13750a.hs
+++ b/testsuite/tests/simplCore/should_run/T13750a.hs
@@ -6,14 +6,15 @@
{-# LANGUAGE ViewPatterns #-}
module T13750a where
+import Data.Kind (Type)
import Unsafe.Coerce
-type family AnyT :: * where {}
-type family AnyList :: [*] where {}
+type family AnyT :: Type where {}
+type family AnyList :: [Type] where {}
-newtype NP (xs :: [*]) = NP [AnyT]
+newtype NP (xs :: [Type]) = NP [AnyT]
-data IsNP (xs :: [*]) where
+data IsNP (xs :: [Type]) where
IsNil :: IsNP '[]
IsCons :: x -> NP xs -> IsNP (x ': xs)
@@ -34,9 +35,9 @@ pattern x :* xs <- (isNP -> IsCons x xs)
x :* NP xs = NP (unsafeCoerce x : xs)
infixr 5 :*
-data NS (xs :: [[*]]) = NS !Int (NP AnyList)
+data NS (xs :: [[Type]]) = NS !Int (NP AnyList)
-data IsNS (xs :: [[*]]) where
+data IsNS (xs :: [[Type]]) where
IsZ :: NP x -> IsNS (x ': xs)
IsS :: NS xs -> IsNS (x ': xs)