diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-02-02 10:06:11 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-03-07 17:01:40 -0500 |
commit | 3e082f8ff5ea2f42c5e6430094683b26b5818fb8 (patch) | |
tree | 4c85427ff40740b654cf1911a20a3a478a9fb754 /testsuite/tests/dependent/should_compile | |
parent | cf65cf16c89414273c4f6b2d090d4b2fffb90759 (diff) | |
download | haskell-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/should_compile')
-rw-r--r-- | testsuite/tests/dependent/should_compile/RaeJobTalk.hs | 18 |
1 files changed, 13 insertions, 5 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. |