summaryrefslogtreecommitdiff
path: root/testsuite/tests/dependent
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-02-02 10:06:11 -0500
committerBen Gamari <ben@smart-cactus.org>2021-03-07 17:01:40 -0500
commit3e082f8ff5ea2f42c5e6430094683b26b5818fb8 (patch)
tree4c85427ff40740b654cf1911a20a3a478a9fb754 /testsuite/tests/dependent
parentcf65cf16c89414273c4f6b2d090d4b2fffb90759 (diff)
downloadhaskell-3e082f8ff5ea2f42c5e6430094683b26b5818fb8.tar.gz
Implement BoxedRep proposalwip/boxed-rep
This implements the BoxedRep proposal, refactoring the `RuntimeRep` hierarchy from: ```haskell data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ... ``` to ```haskell data RuntimeRep = BoxedRep Levity | ... data Levity = Lifted | Unlifted ``` Updates binary, haddock submodules. Closes #17526. Metric Increase: T12545
Diffstat (limited to 'testsuite/tests/dependent')
-rw-r--r--testsuite/tests/dependent/should_compile/RaeJobTalk.hs18
-rw-r--r--testsuite/tests/dependent/should_fail/T17131.stderr4
2 files changed, 15 insertions, 7 deletions
diff --git a/testsuite/tests/dependent/should_compile/RaeJobTalk.hs b/testsuite/tests/dependent/should_compile/RaeJobTalk.hs
index 6c74e10a7c..90a72c2a9a 100644
--- a/testsuite/tests/dependent/should_compile/RaeJobTalk.hs
+++ b/testsuite/tests/dependent/should_compile/RaeJobTalk.hs
@@ -14,12 +14,14 @@ import Data.Type.Bool
import Data.Type.Equality hiding ((:~~:)(..))
import GHC.TypeLits
import Data.Proxy
-import GHC.Exts
+import GHC.Exts hiding (Lifted, BoxedRep)
import Data.Kind
import Unsafe.Coerce
import Data.Char
import Data.Maybe
+import qualified GHC.Exts as Exts
+
-------------------------------
-- Utilities
@@ -82,7 +84,9 @@ data TyCon (a :: k) where
Arrow :: TyCon (->)
TYPE :: TyCon TYPE
RuntimeRep :: TyCon RuntimeRep
- LiftedRep' :: TyCon 'LiftedRep
+ Levity :: TyCon Levity
+ BoxedRep :: TyCon 'Exts.BoxedRep
+ Lifted :: TyCon 'Exts.Lifted
-- If extending, add to eqTyCon too
eqTyCon :: TyCon a -> TyCon b -> Maybe (a :~~: b)
@@ -94,7 +98,9 @@ eqTyCon Maybe Maybe = Just HRefl
eqTyCon Arrow Arrow = Just HRefl
eqTyCon TYPE TYPE = Just HRefl
eqTyCon RuntimeRep RuntimeRep = Just HRefl
-eqTyCon LiftedRep' LiftedRep' = Just HRefl
+eqTyCon Levity Levity = Just HRefl
+eqTyCon BoxedRep BoxedRep = Just HRefl
+eqTyCon Lifted Lifted = Just HRefl
eqTyCon _ _ = Nothing
-- Check whether or not a type is really a plain old tycon;
@@ -212,8 +218,10 @@ instance TyConAble [] where tyCon = List
instance TyConAble Maybe where tyCon = Maybe
instance TyConAble (->) where tyCon = Arrow
instance TyConAble TYPE where tyCon = TYPE
-instance TyConAble 'LiftedRep where tyCon = LiftedRep'
-instance TyConAble RuntimeRep where tyCon = RuntimeRep
+instance TyConAble 'Exts.Lifted where tyCon = Lifted
+instance TyConAble 'Exts.BoxedRep where tyCon = BoxedRep
+instance TyConAble RuntimeRep where tyCon = RuntimeRep
+instance TyConAble Levity where tyCon = Levity
-- Can't just define Typeable the way we want, because the instances
-- overlap. So we have to mock up instance chains via closed type families.
diff --git a/testsuite/tests/dependent/should_fail/T17131.stderr b/testsuite/tests/dependent/should_fail/T17131.stderr
index daad6ac054..b2af8ab7b8 100644
--- a/testsuite/tests/dependent/should_fail/T17131.stderr
+++ b/testsuite/tests/dependent/should_fail/T17131.stderr
@@ -1,9 +1,9 @@
T17131.hs:12:34: error:
• Couldn't match kind: TypeReps xs
- with: '[ 'LiftedRep]
+ with: '[ 'BoxedRep 'Lifted]
Expected kind ‘TYPE ('TupleRep (TypeReps xs))’,
- but ‘(# a #)’ has kind ‘TYPE ('TupleRep '[ 'LiftedRep])’
+ but ‘(# a #)’ has kind ‘TYPE ('TupleRep '[ 'BoxedRep 'Lifted])’
The type variable ‘xs’ is ambiguous
• In the type ‘(# a #)’
In the type family declaration for ‘Tuple#’