summaryrefslogtreecommitdiff
path: root/testsuite/tests/overloadedrecflds
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/overloadedrecflds
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/overloadedrecflds')
-rw-r--r--testsuite/tests/overloadedrecflds/should_run/overloadedrecflds_generics.hs5
-rw-r--r--testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun07.hs6
2 files changed, 6 insertions, 5 deletions
diff --git a/testsuite/tests/overloadedrecflds/should_run/overloadedrecflds_generics.hs b/testsuite/tests/overloadedrecflds/should_run/overloadedrecflds_generics.hs
index c2b4bd6120..56f93fb7af 100644
--- a/testsuite/tests/overloadedrecflds/should_run/overloadedrecflds_generics.hs
+++ b/testsuite/tests/overloadedrecflds/should_run/overloadedrecflds_generics.hs
@@ -17,14 +17,15 @@
import GHC.Generics
import Data.Data
import Data.Proxy
+import Data.Kind
-type family FirstSelector (f :: * -> *) :: Meta
+type family FirstSelector (f :: Type -> Type) :: Meta
type instance FirstSelector (M1 D x f) = FirstSelector f
type instance FirstSelector (M1 C x f) = FirstSelector f
type instance FirstSelector (a :*: b) = FirstSelector a
type instance FirstSelector (M1 S s f) = s
-data SelectorProxy (s :: Meta) (f :: * -> *) a = SelectorProxy
+data SelectorProxy (s :: Meta) (f :: Type -> Type) a = SelectorProxy
type SelectorProxy' (s :: Meta) = SelectorProxy s Proxy ()
-- Extract the first selector name using GHC.Generics
diff --git a/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun07.hs b/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun07.hs
index c492ac87a1..fdd81c213d 100644
--- a/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun07.hs
+++ b/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun07.hs
@@ -1,10 +1,10 @@
{-# LANGUAGE DataKinds
+ , PolyKinds
, FlexibleContexts
, FlexibleInstances
, GADTs
, MultiParamTypeClasses
, OverloadedLabels
- , TypeInType
, ScopedTypeVariables
, TypeApplications
, TypeOperators
@@ -13,13 +13,13 @@
import GHC.OverloadedLabels
import GHC.Records
-import GHC.TypeLits hiding (type (*))
+import GHC.TypeLits
import Data.Kind
data Label (x :: Symbol) = Label
data Labelled x a = Label x := a
-data Rec :: forall k. [(k, *)] -> * where
+data Rec :: forall k. [(k, Type)] -> Type where
Nil :: Rec '[]
(:>) :: Labelled x a -> Rec xs -> Rec ('(x, a) ': xs)
infixr 5 :>