summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-02-16 13:15:29 -0500
committerBen Gamari <ben@smart-cactus.org>2017-02-26 19:18:25 -0500
commit0dea76f2798b921f2dd929128b578ef7d8a47d50 (patch)
tree959e0d47cea4417de405014ffbe2ac56b81a2586
parent5c95e6b7c2790c192720ba5a533d6d11fad570f8 (diff)
downloadhaskell-wip/ttypeable.tar.gz
TcTypeable: Try to reuse KindRepswip/ttypeable
-rw-r--r--compiler/coreSyn/TrieMap.hs28
-rw-r--r--compiler/typecheck/TcTypeable.hs257
-rw-r--r--testsuite/tests/deSugar/should_compile/T2431.stderr83
-rw-r--r--testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr104
-rw-r--r--testsuite/tests/perf/compiler/all.T9
-rw-r--r--testsuite/tests/roles/should_compile/Roles1.stderr101
-rw-r--r--testsuite/tests/roles/should_compile/Roles13.stderr155
-rw-r--r--testsuite/tests/roles/should_compile/Roles14.stderr15
-rw-r--r--testsuite/tests/roles/should_compile/Roles2.stderr31
-rw-r--r--testsuite/tests/roles/should_compile/Roles3.stderr56
-rw-r--r--testsuite/tests/roles/should_compile/Roles4.stderr33
-rw-r--r--testsuite/tests/roles/should_compile/T8958.stderr66
-rw-r--r--testsuite/tests/simplCore/should_compile/T7360.stderr153
-rw-r--r--testsuite/tests/simplCore/should_compile/T8274.stdout14
-rw-r--r--testsuite/tests/th/TH_Roles2.stderr9
15 files changed, 509 insertions, 605 deletions
diff --git a/compiler/coreSyn/TrieMap.hs b/compiler/coreSyn/TrieMap.hs
index 710d80d251..f1c931d364 100644
--- a/compiler/coreSyn/TrieMap.hs
+++ b/compiler/coreSyn/TrieMap.hs
@@ -10,13 +10,22 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module TrieMap(
+ -- * Maps over Core expressions
CoreMap, emptyCoreMap, extendCoreMap, lookupCoreMap, foldCoreMap,
+ -- * Maps over 'Type's
TypeMap, emptyTypeMap, extendTypeMap, lookupTypeMap, foldTypeMap,
LooseTypeMap,
+ -- ** With explicit scoping
+ CmEnv, lookupCME, extendTypeMapWithScope, lookupTypeMapWithScope,
+ mkDeBruijnContext,
+ -- * Maps over 'Maybe' values
MaybeMap,
+ -- * Maps over 'List' values
ListMap,
- TrieMap(..), insertTM, deleteTM,
+ -- * Maps over 'Literal's
LiteralMap,
+ -- * 'TrieMap' class
+ TrieMap(..), insertTM, deleteTM,
lkDFreeVar, xtDFreeVar,
lkDNamed, xtDNamed,
(>.>), (|>), (|>>),
@@ -978,6 +987,21 @@ lookupTypeMap cm t = lookupTM t cm
extendTypeMap :: TypeMap a -> Type -> a -> TypeMap a
extendTypeMap m t v = alterTM t (const (Just v)) m
+lookupTypeMapWithScope :: TypeMap a -> CmEnv -> Type -> Maybe a
+lookupTypeMapWithScope m cm t = lkTT (D cm t) m
+
+-- | Extend a 'TypeMap' with a type in the given context.
+-- @extendTypeMapWithScope m (mkDeBruijnContext [a,b,c]) t v@ is equivalent to
+-- @extendTypeMap m (forall a b c. t) v@, but allows reuse of the context over
+-- multiple insertions.
+extendTypeMapWithScope :: TypeMap a -> CmEnv -> Type -> a -> TypeMap a
+extendTypeMapWithScope m cm t v = xtTT (D cm t) (const (Just v)) m
+
+-- | Construct a deBruijn environment with the given variables in scope.
+-- e.g. @mkDeBruijnEnv [a,b,c]@ constructs a context @forall a b c.@
+mkDeBruijnContext :: [Var] -> CmEnv
+mkDeBruijnContext = extendCMEs emptyCME
+
-- | A 'LooseTypeMap' doesn't do a kind-check. Thus, when lookup up (t |> g),
-- you'll find entries inserted under (t), even if (g) is non-reflexive.
newtype LooseTypeMap a
@@ -1002,7 +1026,7 @@ instance TrieMap LooseTypeMap where
type BoundVar = Int -- Bound variables are deBruijn numbered
type BoundVarMap a = IntMap.IntMap a
-data CmEnv = CME { cme_next :: BoundVar
+data CmEnv = CME { cme_next :: !BoundVar
, cme_env :: VarEnv BoundVar }
emptyCME :: CmEnv
diff --git a/compiler/typecheck/TcTypeable.hs b/compiler/typecheck/TcTypeable.hs
index e7fe588f76..16b982d46e 100644
--- a/compiler/typecheck/TcTypeable.hs
+++ b/compiler/typecheck/TcTypeable.hs
@@ -4,6 +4,7 @@
-}
{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module TcTypeable(mkTypeableBinds) where
@@ -34,12 +35,14 @@ import HsSyn
import DynFlags
import Bag
import Var ( TyVarBndr(..) )
-import VarEnv
+import TrieMap
import Constants
import Fingerprint(Fingerprint(..), fingerprintString, fingerprintFingerprints)
import Outputable
import FastString ( FastString, mkFastString, fsLit )
+import Control.Monad.Trans.State
+import Control.Monad.Trans.Class (lift)
import Data.Maybe ( isJust )
import Data.Word( Word64 )
@@ -156,7 +159,7 @@ mkTypeableBinds
Nothing -> pprPanic "tcMkTypeableBinds" (ppr tycons)
; traceTc "mkTypeableBinds" (ppr tycons)
; this_mod_todos <- todoForTyCons mod mod_id tycons
- ; mkTypeableTyConBinds (this_mod_todos : prim_todos)
+ ; mkTypeRepTodoBinds (this_mod_todos : prim_todos)
} }
where
needs_typeable_binds tc
@@ -257,9 +260,9 @@ todoForTyCons mod mod_id tycons = do
pkg_fpr = fingerprintString $ unitIdString $ moduleUnitId mod
-- | Generate TyCon bindings for a set of type constructors
-mkTypeableTyConBinds :: [TypeRepTodo] -> TcM TcGblEnv
-mkTypeableTyConBinds [] = getGblEnv
-mkTypeableTyConBinds todos
+mkTypeRepTodoBinds :: [TypeRepTodo] -> TcM TcGblEnv
+mkTypeRepTodoBinds [] = getGblEnv
+mkTypeRepTodoBinds todos
= do { stuff <- collect_stuff
-- First extend the type environment with all of the bindings which we
@@ -272,15 +275,10 @@ mkTypeableTyConBinds todos
]
; gbl_env <- tcExtendGlobalValEnv tycon_rep_bndrs getGblEnv
- ; setGblEnv gbl_env $ foldlM (mk_typeable_binds stuff) gbl_env todos }
-
--- | Make bindings for the type representations of a 'TyCon' and its
--- promoted constructors.
-mk_typeable_binds :: TypeableStuff -> TcGblEnv -> TypeRepTodo -> TcM TcGblEnv
-mk_typeable_binds stuff gbl_env todo
- = do pairs <- mapM (mkTyConRepBinds stuff todo) (todo_tycons todo)
- gbl_env <- tcExtendGlobalValEnv (map fst pairs) (return gbl_env)
- return $ gbl_env `addTypecheckedBinds` map snd pairs
+ ; let mk_binds :: TypeRepTodo -> KindRepM [LHsBinds Id]
+ mk_binds todo = mapM (mkTyConRepBinds stuff todo) (todo_tycons todo)
+ ; (gbl_env, binds) <- setGblEnv gbl_env $ runKindRepM (mapM mk_binds todos)
+ ; return $ gbl_env `addTypecheckedBinds` concat binds }
-- | Generate bindings for the type representation of a wired-in 'TyCon's
-- defined by the virtual "GHC.Prim" module. This is where we inject the
@@ -299,7 +297,8 @@ mkPrimTypeableTodos
; ghc_prim_module_bind <- mkVarBind ghc_prim_module_id
<$> mkModIdRHS gHC_PRIM
- ; gbl_env <- tcExtendGlobalValEnv [ghc_prim_module_id] getGblEnv
+ ; gbl_env <- tcExtendGlobalValEnv [ghc_prim_module_id]
+ getGblEnv
; let gbl_env' = gbl_env `addTypecheckedBinds`
[unitBag ghc_prim_module_bind]
; todo <- todoForTyCons gHC_PRIM ghc_prim_module_id
@@ -372,20 +371,21 @@ mkTrNameLit = do
`nlHsApp` nlHsLit (mkHsStringPrimLit fs)
return trNameLit
--- | Make typeable bindings for the given 'TyCon'.
+-- | Make Typeable bindings for the given 'TyCon'.
mkTyConRepBinds :: TypeableStuff -> TypeRepTodo
- -> TypeableTyCon -> TcRn (Id, LHsBinds Id)
+ -> TypeableTyCon -> KindRepM (LHsBinds Id)
mkTyConRepBinds stuff@(Stuff {..}) todo (TypeableTyCon {..})
- = do -- Place a NOINLINE pragma on KindReps since they tend to be quite large
- -- and bloat interface files.
- kind_rep_id <- (`setInlinePragma` neverInlinePragma)
- <$> newSysLocalId (fsLit "krep") (mkTyConTy kindRepTyCon)
- kind_rep <- mkTyConKindRep stuff tycon tycon_kind
-
- tycon_rep_rhs <- mkTyConRepTyConRHS stuff todo tycon kind_rep_id
- let tycon_rep_bind = mkVarBind tycon_rep_id tycon_rep_rhs
- kind_rep_bind = mkVarBind kind_rep_id kind_rep
- return (kind_rep_id, listToBag [tycon_rep_bind, kind_rep_bind])
+ = do -- Make a KindRep
+ let (bndrs, kind) = splitForAllTyVarBndrs tycon_kind
+ liftTc $ traceTc "mkTyConKindRepBinds"
+ (ppr tycon $$ ppr tycon_kind $$ ppr kind)
+ let ctx = mkDeBruijnContext (map binderVar bndrs)
+ kind_rep <- getKindRep stuff ctx kind
+
+ -- Make the TyCon binding
+ let tycon_rep_rhs = mkTyConRepTyConRHS stuff todo tycon kind_rep
+ tycon_rep_bind = mkVarBind tycon_rep_id tycon_rep_rhs
+ return $ unitBag tycon_rep_bind
-- | Here is where we define the set of Typeable types. These exclude type
-- families and polytypes.
@@ -417,19 +417,132 @@ typeIsTypeable (LitTy _) = True
typeIsTypeable (CastTy{}) = False
typeIsTypeable (CoercionTy{}) = panic "typeIsTypeable(Coercion)"
+-- | Maps kinds to 'KindRep' bindings (or rather, a pair of the bound identifier
+-- and its RHS).
+type KindRepEnv = TypeMap (Id, LHsExpr Id)
+
+-- | A monad within which we will generate 'KindRep's. Here we keep an
+-- environments containing 'KindRep's which we've already generated so we can
+-- re-use them opportunistically.
+newtype KindRepM a = KindRepM { unKindRepM :: StateT KindRepEnv TcRn a }
+ deriving (Functor, Applicative, Monad)
+
+liftTc :: TcRn a -> KindRepM a
+liftTc = KindRepM . lift
+
+-- | Run a 'KindRepM' and add the produced 'KindRep's to the typechecking
+-- environment.
+runKindRepM :: KindRepM a -> TcRn (TcGblEnv, a)
+runKindRepM (KindRepM action) = do
+ (res, reps_env) <- runStateT action emptyTypeMap
+ let reps = foldTypeMap (:) [] reps_env
+ tcg_env <- tcExtendGlobalValEnv (map fst reps) getGblEnv
+ let to_bind :: (Id, LHsExpr Id) -> LHsBind Id
+ to_bind = uncurry mkVarBind
+ tcg_env' = tcg_env `addTypecheckedBinds` map (unitBag . to_bind) reps
+ return (tcg_env', res)
+
+-- | Produce or find a 'KindRep' for the given kind.
+getKindRep :: TypeableStuff -> CmEnv -- ^ in-scope kind variables
+ -> Kind -- ^ the kind we want a 'KindRep' for
+ -> KindRepM (LHsExpr Id)
+getKindRep (Stuff {..}) in_scope = go
+ where
+ go :: Kind -> KindRepM (LHsExpr Id)
+ go = KindRepM . StateT . go'
+
+ go' :: Kind -> KindRepEnv -> TcRn (LHsExpr Id, KindRepEnv)
+ go' k env
+ -- Look through type synonyms
+ | Just k' <- coreView k = go' k' env
+
+ -- We've already generated the needed KindRep
+ | Just (id, _) <- lookupTypeMapWithScope env in_scope k
+ = return (nlHsVar id, env)
+
+ -- We need to construct a new KindRep binding
+ | otherwise
+ = do -- Place a NOINLINE pragma on KindReps since they tend to be quite
+ -- large and bloat interface files.
+ rep_bndr <- (`setInlinePragma` neverInlinePragma)
+ <$> newSysLocalId (fsLit "krep") (mkTyConTy kindRepTyCon)
+
+ -- do we need to tie a knot here?
+ (rhs, env') <- runStateT (unKindRepM $ new_kind_rep k) env
+ let env'' = extendTypeMapWithScope env' in_scope k (rep_bndr, rhs)
+ return (nlHsVar rep_bndr, env'')
+
+
+ new_kind_rep :: Kind -- ^ the kind we want a 'KindRep' for
+ -> KindRepM (LHsExpr Id)
+ new_kind_rep k
+ -- We handle TYPE separately to make it clear to consumers
+ -- (e.g. serializers) that there is a loop here (as
+ -- TYPE :: RuntimeRep -> TYPE 'LiftedRep)
+ | Just rr <- isTYPEApp k
+ = return $ nlHsDataCon kindRepTYPEDataCon `nlHsApp` nlHsDataCon rr
+
+ new_kind_rep (TyVarTy v)
+ | Just idx <- lookupCME in_scope v
+ = return $ nlHsDataCon kindRepVarDataCon
+ `nlHsApp` nlHsIntLit (fromIntegral idx)
+ | otherwise
+ = pprPanic "mkTyConKindRepBinds.go(tyvar)" (ppr v)
+
+ new_kind_rep (AppTy t1 t2)
+ = do rep1 <- go t1
+ rep2 <- go t2
+ return $ nlHsDataCon kindRepAppDataCon
+ `nlHsApp` rep1 `nlHsApp` rep2
+
+ new_kind_rep k@(TyConApp tc tys)
+ | Just rep_name <- tyConRepName_maybe tc
+ = do rep_id <- liftTc $ lookupId rep_name
+ tys' <- mapM go tys
+ return $ nlHsDataCon kindRepTyConAppDataCon
+ `nlHsApp` nlHsVar rep_id
+ `nlHsApp` mkList (mkTyConTy kindRepTyCon) tys'
+ | otherwise
+ = pprPanic "mkTyConKindRepBinds(TyConApp)" (ppr tc $$ ppr k)
+
+ new_kind_rep (ForAllTy (TvBndr var _) ty)
+ = pprPanic "mkTyConKindRepBinds(ForAllTy)" (ppr var $$ ppr ty)
+
+ new_kind_rep (FunTy t1 t2)
+ = do rep1 <- go t1
+ rep2 <- go t2
+ return $ nlHsDataCon kindRepFunDataCon
+ `nlHsApp` rep1 `nlHsApp` rep2
+
+ new_kind_rep (LitTy (NumTyLit n))
+ = return $ nlHsDataCon kindRepTypeLitSDataCon
+ `nlHsApp` nlHsDataCon typeLitNatDataCon
+ `nlHsApp` nlHsLit (mkHsStringPrimLit $ mkFastString $ show n)
+
+ new_kind_rep (LitTy (StrTyLit s))
+ = return $ nlHsDataCon kindRepTypeLitSDataCon
+ `nlHsApp` nlHsDataCon typeLitSymbolDataCon
+ `nlHsApp` nlHsLit (mkHsStringPrimLit $ mkFastString $ show s)
+
+ new_kind_rep (CastTy ty co)
+ = pprPanic "mkTyConKindRepBinds.go(cast)" (ppr ty $$ ppr co)
+
+ new_kind_rep (CoercionTy co)
+ = pprPanic "mkTyConKindRepBinds.go(coercion)" (ppr co)
+
-- | Produce the right-hand-side of a @TyCon@ representation.
mkTyConRepTyConRHS :: TypeableStuff -> TypeRepTodo
- -> TyCon -> Id
- -> TcRn (LHsExpr Id)
-mkTyConRepTyConRHS (Stuff {..}) todo tycon kind_rep_id
- = do let rep_rhs = nlHsDataCon trTyConDataCon
- `nlHsApp` nlHsLit (word64 dflags high)
- `nlHsApp` nlHsLit (word64 dflags low)
- `nlHsApp` mod_rep_expr todo
- `nlHsApp` trNameLit (mkFastString tycon_str)
- `nlHsApp` nlHsLit (int n_kind_vars)
- `nlHsApp` nlHsVar kind_rep_id
- return rep_rhs
+ -> TyCon -- ^ the 'TyCon' we are producing a binding for
+ -> LHsExpr Id -- ^ its 'KindRep'
+ -> LHsExpr Id
+mkTyConRepTyConRHS (Stuff {..}) todo tycon kind_rep
+ = nlHsDataCon trTyConDataCon
+ `nlHsApp` nlHsLit (word64 dflags high)
+ `nlHsApp` nlHsLit (word64 dflags low)
+ `nlHsApp` mod_rep_expr todo
+ `nlHsApp` trNameLit (mkFastString tycon_str)
+ `nlHsApp` nlHsLit (int n_kind_vars)
+ `nlHsApp` kind_rep
where
n_kind_vars = length $ filter isNamedTyConBinder (tyConBinders tycon)
tycon_str = add_tick (occNameString (getOccName tycon))
@@ -502,70 +615,12 @@ data Maybe a = Nothing | Just a
F :: forall k. k -> forall k'. k' -> Type
-}
--- | Produce a @KindRep@ expression for the kind of the given 'TyCon'.
-mkTyConKindRep :: TypeableStuff -> TyCon -> Kind -> TcRn (LHsExpr Id)
-mkTyConKindRep (Stuff {..}) tycon tycon_kind = do
- let (bndrs, kind) = splitForAllTyVarBndrs tycon_kind
- bndr_idxs = mkVarEnv $ (`zip` [0..]) $ map binderVar bndrs
- traceTc "mkTyConKindRepBinds"
- (ppr tycon $$ ppr tycon_kind $$ ppr kind $$ ppr bndr_idxs)
- go bndr_idxs kind
+mkList :: Type -> [LHsExpr Id] -> LHsExpr Id
+mkList ty = foldr consApp (nilExpr ty)
where
- -- Compute RHS
- go :: VarEnv Int -> Kind -> TcRn (LHsExpr Id)
- go bndrs ty
- | Just ty' <- coreView ty
- = go bndrs ty'
- go bndrs (TyVarTy v)
- | Just idx <- lookupVarEnv bndrs v
- = return $ nlHsDataCon kindRepVarDataCon
- `nlHsApp` nlHsIntLit (fromIntegral idx)
- | otherwise
- = pprPanic "mkTyConKindRepBinds.go(tyvar)" (ppr v $$ ppr bndrs)
- go bndrs (AppTy t1 t2)
- = do t1' <- go bndrs t1
- t2' <- go bndrs t2
- return $ nlHsDataCon kindRepAppDataCon
- `nlHsApp` t1' `nlHsApp` t2'
- go _ ty | Just rr <- isTYPEApp ty
- = return $ nlHsDataCon kindRepTYPEDataCon `nlHsApp` nlHsDataCon rr
- go bndrs (TyConApp tc tys)
- | Just rep_name <- tyConRepName_maybe tc
- = do rep_id <- lookupId rep_name
- tys' <- mapM (go bndrs) tys
- return $ nlHsDataCon kindRepTyConAppDataCon
- `nlHsApp` nlHsVar rep_id
- `nlHsApp` mkList (mkTyConTy kindRepTyCon) tys'
- | otherwise
- = pprPanic "mkTyConKindRepBinds(TyConApp)"
- (ppr tc $$ ppr tycon_kind)
- go _ (ForAllTy (TvBndr var _) ty)
- -- = let bndrs' = extendVarEnv (mapVarEnv (+1) bndrs) var 0 in go bndrs' ty
- = pprPanic "mkTyConKindRepBinds(ForAllTy)" (ppr var $$ ppr ty)
- go bndrs (FunTy t1 t2)
- = do t1' <- go bndrs t1
- t2' <- go bndrs t2
- return $ nlHsDataCon kindRepFunDataCon
- `nlHsApp` t1' `nlHsApp` t2'
- go _ (LitTy (NumTyLit n))
- = return $ nlHsDataCon kindRepTypeLitSDataCon
- `nlHsApp` nlHsDataCon typeLitNatDataCon
- `nlHsApp` nlHsLit (mkHsStringPrimLit $ mkFastString $ show n)
- go _ (LitTy (StrTyLit s))
- = return $ nlHsDataCon kindRepTypeLitSDataCon
- `nlHsApp` nlHsDataCon typeLitSymbolDataCon
- `nlHsApp` nlHsLit (mkHsStringPrimLit $ mkFastString $ show s)
- go _ (CastTy ty co)
- = pprPanic "mkTyConKindRepBinds.go(cast)" (ppr ty $$ ppr co)
- go _ (CoercionTy co)
- = pprPanic "mkTyConKindRepBinds.go(coercion)" (ppr co)
-
- mkList :: Type -> [LHsExpr Id] -> LHsExpr Id
- mkList ty = foldr consApp (nilExpr ty)
- where
- cons = consExpr ty
- consApp :: LHsExpr Id -> LHsExpr Id -> LHsExpr Id
- consApp x xs = cons `nlHsApp` x `nlHsApp` xs
+ cons = consExpr ty
+ consApp :: LHsExpr Id -> LHsExpr Id -> LHsExpr Id
+ consApp x xs = cons `nlHsApp` x `nlHsApp` xs
nilExpr :: Type -> LHsExpr Id
nilExpr ty = mkLHsWrap (mkWpTyApps [ty]) (nlHsDataCon nilDataCon)
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr
index d601d5d48f..16bda5890f 100644
--- a/testsuite/tests/deSugar/should_compile/T2431.stderr
+++ b/testsuite/tests/deSugar/should_compile/T2431.stderr
@@ -1,7 +1,7 @@
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 83, types: 49, coercions: 1, joins: 0/0}
+ = {terms: 74, types: 46, coercions: 1, joins: 0/0}
-- RHS size: {terms: 2, types: 4, coercions: 1, joins: 0/0}
T2431.$WRefl [InlPrag=INLINE] :: forall a. a :~: a
@@ -13,9 +13,9 @@ T2431.$WRefl [InlPrag=INLINE] :: forall a. a :~: a
Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)
Tmpl= \ (@ a) ->
T2431.Refl @ a @ a @~ (<a>_N :: (a :: *) GHC.Prim.~# (a :: *))}]
-T2431.$WRefl =
- \ (@ a) ->
- T2431.Refl @ a @ a @~ (<a>_N :: (a :: *) GHC.Prim.~# (a :: *))
+T2431.$WRefl
+ = \ (@ a) ->
+ T2431.Refl @ a @ a @~ (<a>_N :: (a :: *) GHC.Prim.~# (a :: *))
-- RHS size: {terms: 4, types: 8, coercions: 0, joins: 0/0}
absurd :: forall a. (Int :~: Bool) -> a
@@ -52,25 +52,20 @@ krep :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
krep = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
krep1 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep1 = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+krep1 = GHC.Types.KindRepFun krep krep
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
krep2 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep2 = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+krep2 = GHC.Types.KindRepFun krep krep1
--- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
krep3 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep3 = GHC.Types.KindRepFun krep1 krep2
-
--- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-krep4 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep4 = GHC.Types.KindRepFun krep krep3
+krep3 = GHC.Types.KindRepVar 0#
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc:~:1 :: GHC.Prim.Addr#
@@ -85,41 +80,31 @@ $tc:~:2 = GHC.Types.TrNameS $tc:~:1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
T2431.$tc:~: :: GHC.Types.TyCon
[GblId, Caf=NoCafRefs]
-T2431.$tc:~: =
- GHC.Types.TyCon
- 4608886815921030019##
- 6030312177285011233##
- T2431.$trModule
- $tc:~:2
- 0#
- krep4
-
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-krep5 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep5 = GHC.Types.KindRepVar 0#
-
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-krep6 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep6 = GHC.Types.KindRepVar 0#
+T2431.$tc:~:
+ = GHC.Types.TyCon
+ 4608886815921030019##
+ 6030312177285011233##
+ T2431.$trModule
+ $tc:~:2
+ 0#
+ krep2
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
-krep7 :: [GHC.Types.KindRep]
+krep4 :: [GHC.Types.KindRep]
[GblId, Caf=NoCafRefs]
-krep7 =
- GHC.Types.:
- @ GHC.Types.KindRep krep6 (GHC.Types.[] @ GHC.Types.KindRep)
+krep4
+ = GHC.Types.:
+ @ GHC.Types.KindRep krep3 (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
-krep8 :: [GHC.Types.KindRep]
+krep5 :: [GHC.Types.KindRep]
[GblId, Caf=NoCafRefs]
-krep8 = GHC.Types.: @ GHC.Types.KindRep krep5 krep7
+krep5 = GHC.Types.: @ GHC.Types.KindRep krep3 krep4
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-krep9 :: GHC.Types.KindRep
+krep6 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep9 = GHC.Types.KindRepTyConApp T2431.$tc:~: krep8
+krep6 = GHC.Types.KindRepTyConApp T2431.$tc:~: krep5
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Refl1 :: GHC.Prim.Addr#
@@ -134,14 +119,14 @@ $tc'Refl2 = GHC.Types.TrNameS $tc'Refl1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
T2431.$tc'Refl :: GHC.Types.TyCon
[GblId, Caf=NoCafRefs]
-T2431.$tc'Refl =
- GHC.Types.TyCon
- 2478588351447975921##
- 2684375695874497811##
- T2431.$trModule
- $tc'Refl2
- 1#
- krep9
+T2431.$tc'Refl
+ = GHC.Types.TyCon
+ 2478588351447975921##
+ 2684375695874497811##
+ T2431.$trModule
+ $tc'Refl2
+ 1#
+ krep6
diff --git a/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr b/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
index c7db52a5df..bb98450397 100644
--- a/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
+++ b/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
@@ -53,17 +53,6 @@
({ <no location info> }{Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})})))))
(False))),
({ <no location info> }
- (VarBind {Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})}
- ({ <no location info> }
- (HsApp
- ({ <no location info> }
- (HsConLikeOut
- ({abstract:ConLike})))
- ({ <no location info> }
- (HsConLikeOut
- ({abstract:ConLike})))))
- (False))),
- ({ <no location info> }
(VarBind {Var: (main:DumpTypecheckedAst.$tc'Zero{v} [lidx] :: ghc-prim:GHC.Types.TyCon{tc})}
({ <no location info> }
(HsApp
@@ -114,27 +103,6 @@
({ <no location info> }{Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})})))))
(False))),
({ <no location info> }
- (VarBind {Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})}
- ({ <no location info> }
- (HsApp
- ({ <no location info> }
- (HsApp
- ({ <no location info> }
- (HsConLikeOut
- ({abstract:ConLike})))
- ({ <no location info> }
- (HsVar
- ({ <no location info> }{Var: (main:DumpTypecheckedAst.$tcPeano{v} [lidx] :: ghc-prim:GHC.Types.TyCon{tc})})))))
- ({ <no location info> }
- (HsWrap
- (WpTyApp
- (TyConApp
- ({abstract:TyCon})
- []))
- (HsConLikeOut
- ({abstract:ConLike}))))))
- (False))),
- ({ <no location info> }
(VarBind {Var: (main:DumpTypecheckedAst.$tc'Succ{v} [lidx] :: ghc-prim:GHC.Types.TyCon{tc})}
({ <no location info> }
(HsApp
@@ -194,45 +162,43 @@
(HsConLikeOut
({abstract:ConLike})))
({ <no location info> }
- (HsPar
- ({ <no location info> }
- (HsApp
- ({ <no location info> }
- (HsApp
- ({ <no location info> }
- (HsConLikeOut
- ({abstract:ConLike})))
- ({ <no location info> }
- (HsVar
- ({ <no location info> }{Var: (main:DumpTypecheckedAst.$tcPeano{v} [lidx] :: ghc-prim:GHC.Types.TyCon{tc})})))))
- ({ <no location info> }
- (HsWrap
- (WpTyApp
- (TyConApp
- ({abstract:TyCon})
- []))
- (HsConLikeOut
- ({abstract:ConLike}))))))))))
+ (HsVar
+ ({ <no location info> }{Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})})))))
({ <no location info> }
- (HsPar
+ (HsVar
+ ({ <no location info> }{Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})})))))
+ (False))),
+ ({ <no location info> }
+ (VarBind {Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})}
+ ({ <no location info> }
+ (HsApp
+ ({ <no location info> }
+ (HsConLikeOut
+ ({abstract:ConLike})))
+ ({ <no location info> }
+ (HsConLikeOut
+ ({abstract:ConLike})))))
+ (False))),
+ ({ <no location info> }
+ (VarBind {Var: (krep{v} [lid] :: ghc-prim:GHC.Types.KindRep{tc})}
+ ({ <no location info> }
+ (HsApp
+ ({ <no location info> }
+ (HsApp
({ <no location info> }
- (HsApp
- ({ <no location info> }
- (HsApp
- ({ <no location info> }
- (HsConLikeOut
- ({abstract:ConLike})))
- ({ <no location info> }
- (HsVar
- ({ <no location info> }{Var: (main:DumpTypecheckedAst.$tcPeano{v} [lidx] :: ghc-prim:GHC.Types.TyCon{tc})})))))
- ({ <no location info> }
- (HsWrap
- (WpTyApp
- (TyConApp
- ({abstract:TyCon})
- []))
- (HsConLikeOut
- ({abstract:ConLike}))))))))))
+ (HsConLikeOut
+ ({abstract:ConLike})))
+ ({ <no location info> }
+ (HsVar
+ ({ <no location info> }{Var: (main:DumpTypecheckedAst.$tcPeano{v} [lidx] :: ghc-prim:GHC.Types.TyCon{tc})})))))
+ ({ <no location info> }
+ (HsWrap
+ (WpTyApp
+ (TyConApp
+ ({abstract:TyCon})
+ []))
+ (HsConLikeOut
+ ({abstract:ConLike}))))))
(False))),
({ <no location info> }
(VarBind {Var: (main:DumpTypecheckedAst.$trModule{v} [lidx] :: ghc-prim:GHC.Types.Module{tc})}
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 757bd36fe5..0e1aa8d9ac 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -424,7 +424,7 @@ test('T5631',
# 2014-04-04: 346389856 (x86 Windows, 64 bit machine)
# 2014-12-01: 390199244 (Windows laptop)
# 2016-04-06: 570137436 (amd64/Linux) many reasons
- (wordsize(64), 1517484488, 5)]),
+ (wordsize(64), 1090533760, 5)]),
# expected value: 774595008 (amd64/Linux):
# expected value: 735486328 (amd64/Linux) 2012/12/12:
# expected value: 690742040 (amd64/Linux) Call Arity improvements
@@ -437,6 +437,7 @@ test('T5631',
# 2016-10-19: 1024926024 (amd64/Linux) Refactor traceRn interface (#12617)
# 2016-11-10: 1077429456 (amd64/Linux) Stop -dno-debug-output suppressing -ddump-tc-trace
# 2017-02-17: 1517484488 (amd64/Linux) Type-indexed Typeable
+ # 2017-02-20: 1090533760 (amd64/Linux) Deduplicate Typeable bindings
only_ways(['normal'])
],
compile,
@@ -804,7 +805,7 @@ test('T9872c',
test('T9872d',
[ only_ways(['normal']),
compiler_stats_num_field('bytes allocated',
- [(wordsize(64), 535565128, 5),
+ [(wordsize(64), 496098088, 5),
# 2014-12-18 796071864 Initally created
# 2014-12-18 739189056 Reduce type families even more eagerly
# 2015-01-07 687562440 TrieMap leaf compression
@@ -815,6 +816,7 @@ test('T9872d',
# 2016-12-05 478169352 using tyConIsTyFamFree, I think, but only
# a 1% improvement 482 -> 478
# 2017-02-17 535565128 Type-indexed Typeable
+ # 2017-02-20 496098088 Deduplicate Typeable bindings
(wordsize(32), 264566040, 5)
# some date 328810212
# 2015-07-11 350369584
@@ -936,10 +938,11 @@ test('T12227',
test('T12425',
[ only_ways(['optasm']),
compiler_stats_num_field('bytes allocated',
- [(wordsize(64), 153611448, 5),
+ [(wordsize(64), 143043544, 5),
# initial: 125831400
# 2017-01-18: 133380960 Allow top-level string literals in Core
# 2017-02-17: 153611448 Type-indexed Typeable
+ # 2017-02-20: 143043544 Deduplicate Typeable bindings
]),
],
compile,
diff --git a/testsuite/tests/roles/should_compile/Roles1.stderr b/testsuite/tests/roles/should_compile/Roles1.stderr
index a81e7c0187..c9be2ea3cd 100644
--- a/testsuite/tests/roles/should_compile/Roles1.stderr
+++ b/testsuite/tests/roles/should_compile/Roles1.stderr
@@ -33,12 +33,6 @@ Roles1.$tcT7
(GHC.Types.TrNameS "T7"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep))
Roles1.$tc'K7
= GHC.Types.TyCon
15901479081375327280##
@@ -47,14 +41,6 @@ Roles1.$tc'K7
(GHC.Types.TrNameS "'K7"#)
3
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 2)
- (GHC.Types.KindRepTyConApp
- Roles1.$tcT7
- ((:)
- (GHC.Types.KindRepVar 0)
- ((:) (GHC.Types.KindRepVar 1) ((:) (GHC.Types.KindRepVar 2) []))))
Roles1.$tcT6
= GHC.Types.TyCon
7244893995195634045##
@@ -63,10 +49,6 @@ Roles1.$tcT6
(GHC.Types.TrNameS "T6"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
Roles1.$tc'K6
= GHC.Types.TyCon
13928703131159360198##
@@ -75,10 +57,6 @@ Roles1.$tc'K6
(GHC.Types.TrNameS "'K6"#)
2
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepTyConApp
- Roles1.$tcT6
- ((:) (GHC.Types.KindRepVar 0) ((:) (GHC.Types.KindRepVar 1) []))
Roles1.$tcT5
= GHC.Types.TyCon
12033401645911719002##
@@ -87,10 +65,6 @@ Roles1.$tcT5
(GHC.Types.TrNameS "T5"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
Roles1.$tc'K5
= GHC.Types.TyCon
5548842497263642061##
@@ -99,11 +73,6 @@ Roles1.$tc'K5
(GHC.Types.TrNameS "'K5"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepTyConApp
- Roles1.$tcT5 ((:) (GHC.Types.KindRepVar 0) []))
Roles1.$tcT4
= GHC.Types.TyCon
15834077582937152787##
@@ -112,14 +81,6 @@ Roles1.$tcT4
(GHC.Types.TrNameS "T4"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep))
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep))
Roles1.$tc'K4
= GHC.Types.TyCon
10188453925450404995##
@@ -128,13 +89,6 @@ Roles1.$tc'K4
(GHC.Types.TrNameS "'K4"#)
2
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepApp
- (GHC.Types.KindRepVar 0) (GHC.Types.KindRepVar 1))
- (GHC.Types.KindRepTyConApp
- Roles1.$tcT4
- ((:) (GHC.Types.KindRepVar 0) ((:) (GHC.Types.KindRepVar 1) [])))
Roles1.$tcT3
= GHC.Types.TyCon
13341737262627465733##
@@ -143,10 +97,6 @@ Roles1.$tcT3
(GHC.Types.TrNameS "T3"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
Roles1.$tc'K3
= GHC.Types.TyCon
14534968069054730342##
@@ -155,10 +105,6 @@ Roles1.$tc'K3
(GHC.Types.TrNameS "'K3"#)
2
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepTyConApp
- Roles1.$tcT3
- ((:) (GHC.Types.KindRepVar 0) ((:) (GHC.Types.KindRepVar 1) []))
Roles1.$tcT2
= GHC.Types.TyCon
12900773996789723956##
@@ -167,10 +113,6 @@ Roles1.$tcT2
(GHC.Types.TrNameS "T2"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
Roles1.$tc'K2
= GHC.Types.TyCon
11054915488163123841##
@@ -179,11 +121,6 @@ Roles1.$tc'K2
(GHC.Types.TrNameS "'K2"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepTyConApp
- Roles1.$tcT2 ((:) (GHC.Types.KindRepVar 0) []))
Roles1.$tcT1
= GHC.Types.TyCon
13228660854624297872##
@@ -192,10 +129,6 @@ Roles1.$tcT1
(GHC.Types.TrNameS "T1"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
Roles1.$tc'K1
= GHC.Types.TyCon
1265606750138351672##
@@ -204,11 +137,37 @@ Roles1.$tc'K1
(GHC.Types.TrNameS "'K1"#)
1
krep
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 1
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 1
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 2
+krep [InlPrag=[~]] = GHC.Types.KindRepApp krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp
+ Roles1.$tcT7 ((:) krep ((:) krep ((:) krep [])))
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles1.$tcT6 ((:) krep ((:) krep []))
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles1.$tcT4 ((:) krep ((:) krep []))
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles1.$tcT3 ((:) krep ((:) krep []))
+krep [InlPrag=[~]] = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles1.$tcT5 ((:) krep [])
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles1.$tcT2 ((:) krep [])
krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepTyConApp
- Roles1.$tcT1 ((:) (GHC.Types.KindRepVar 0) []))
+ = GHC.Types.KindRepTyConApp Roles1.$tcT1 ((:) krep [])
Roles1.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles1"#)
diff --git a/testsuite/tests/roles/should_compile/Roles13.stderr b/testsuite/tests/roles/should_compile/Roles13.stderr
index f336a69be1..cc8dfdfc29 100644
--- a/testsuite/tests/roles/should_compile/Roles13.stderr
+++ b/testsuite/tests/roles/should_compile/Roles13.stderr
@@ -1,7 +1,7 @@
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 114, types: 43, coercions: 5, joins: 0/0}
+ = {terms: 105, types: 40, coercions: 5, joins: 0/0}
-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0}
convert1 :: Wrap Age -> Wrap Age
@@ -11,10 +11,10 @@ convert1 = \ (ds :: Wrap Age) -> ds
-- RHS size: {terms: 1, types: 0, coercions: 5, joins: 0/0}
convert :: Wrap Age -> Int
[GblId, Arity=1, Caf=NoCafRefs]
-convert =
- convert1
- `cast` (<Wrap Age>_R -> Roles13.N:Wrap[0] Roles13.N:Age[0]
- :: ((Wrap Age -> Wrap Age) :: *) ~R# ((Wrap Age -> Int) :: *))
+convert
+ = convert1
+ `cast` (<Wrap Age>_R -> Roles13.N:Wrap[0] Roles13.N:Age[0]
+ :: ((Wrap Age -> Wrap Age) :: *) ~R# ((Wrap Age -> Int) :: *))
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule1 :: GHC.Prim.Addr#
@@ -41,10 +41,27 @@ Roles13.$trModule :: GHC.Types.Module
[GblId, Caf=NoCafRefs]
Roles13.$trModule = GHC.Types.Module $trModule2 $trModule4
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
krep :: GHC.Types.KindRep
+[GblId]
+krep
+ = GHC.Types.KindRepTyConApp
+ GHC.Types.$tcInt (GHC.Types.[] @ GHC.Types.KindRep)
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+krep1 :: GHC.Types.KindRep
+[GblId, Caf=NoCafRefs]
+krep1 = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+krep2 :: GHC.Types.KindRep
+[GblId, Caf=NoCafRefs]
+krep2 = GHC.Types.KindRepFun krep1 krep1
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+krep3 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+krep3 = GHC.Types.KindRepVar 0#
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcAge1 :: GHC.Prim.Addr#
@@ -59,33 +76,26 @@ $tcAge2 = GHC.Types.TrNameS $tcAge1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tcAge :: GHC.Types.TyCon
[GblId, Caf=NoCafRefs]
-Roles13.$tcAge =
- GHC.Types.TyCon
- 3456257068627873222##
- 14056710845110756026##
- Roles13.$trModule
- $tcAge2
- 0#
- krep
+Roles13.$tcAge
+ = GHC.Types.TyCon
+ 3456257068627873222##
+ 14056710845110756026##
+ Roles13.$trModule
+ $tcAge2
+ 0#
+ krep1
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
-krep1 :: GHC.Types.KindRep
-[GblId]
-krep1 =
- GHC.Types.KindRepTyConApp
- GHC.Types.$tcInt (GHC.Types.[] @ GHC.Types.KindRep)
-
--- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
-krep2 :: GHC.Types.KindRep
+krep4 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep2 =
- GHC.Types.KindRepTyConApp
- Roles13.$tcAge (GHC.Types.[] @ GHC.Types.KindRep)
+krep4
+ = GHC.Types.KindRepTyConApp
+ Roles13.$tcAge (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-krep3 :: GHC.Types.KindRep
+krep5 :: GHC.Types.KindRep
[GblId]
-krep3 = GHC.Types.KindRepFun krep1 krep2
+krep5 = GHC.Types.KindRepFun krep krep4
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'MkAge1 :: GHC.Prim.Addr#
@@ -100,29 +110,14 @@ $tc'MkAge2 = GHC.Types.TrNameS $tc'MkAge1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tc'MkAge :: GHC.Types.TyCon
[GblId]
-Roles13.$tc'MkAge =
- GHC.Types.TyCon
- 18264039750958872441##
- 1870189534242358050##
- Roles13.$trModule
- $tc'MkAge2
- 0#
- krep3
-
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-krep4 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep4 = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
-
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-krep5 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep5 = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
-
--- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-krep6 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep6 = GHC.Types.KindRepFun krep4 krep5
+Roles13.$tc'MkAge
+ = GHC.Types.TyCon
+ 18264039750958872441##
+ 1870189534242358050##
+ Roles13.$trModule
+ $tc'MkAge2
+ 0#
+ krep5
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcWrap1 :: GHC.Prim.Addr#
@@ -137,41 +132,31 @@ $tcWrap2 = GHC.Types.TrNameS $tcWrap1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tcWrap :: GHC.Types.TyCon
[GblId, Caf=NoCafRefs]
-Roles13.$tcWrap =
- GHC.Types.TyCon
- 13773534096961634492##
- 15591525585626702988##
- Roles13.$trModule
- $tcWrap2
- 0#
- krep6
-
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-krep7 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep7 = GHC.Types.KindRepVar 0#
-
--- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-krep8 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
-krep8 = GHC.Types.KindRepVar 0#
+Roles13.$tcWrap
+ = GHC.Types.TyCon
+ 13773534096961634492##
+ 15591525585626702988##
+ Roles13.$trModule
+ $tcWrap2
+ 0#
+ krep2
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
-krep9 :: [GHC.Types.KindRep]
+krep6 :: [GHC.Types.KindRep]
[GblId, Caf=NoCafRefs]
-krep9 =
- GHC.Types.:
- @ GHC.Types.KindRep krep8 (GHC.Types.[] @ GHC.Types.KindRep)
+krep6
+ = GHC.Types.:
+ @ GHC.Types.KindRep krep3 (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-krep10 :: GHC.Types.KindRep
+krep7 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep10 = GHC.Types.KindRepTyConApp Roles13.$tcWrap krep9
+krep7 = GHC.Types.KindRepTyConApp Roles13.$tcWrap krep6
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-krep11 :: GHC.Types.KindRep
+krep8 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs]
-krep11 = GHC.Types.KindRepFun krep7 krep10
+krep8 = GHC.Types.KindRepFun krep3 krep7
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'MkWrap1 :: GHC.Prim.Addr#
@@ -186,14 +171,14 @@ $tc'MkWrap2 = GHC.Types.TrNameS $tc'MkWrap1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tc'MkWrap :: GHC.Types.TyCon
[GblId, Caf=NoCafRefs]
-Roles13.$tc'MkWrap =
- GHC.Types.TyCon
- 15580677875333883466##
- 808508687714473149##
- Roles13.$trModule
- $tc'MkWrap2
- 1#
- krep11
+Roles13.$tc'MkWrap
+ = GHC.Types.TyCon
+ 15580677875333883466##
+ 808508687714473149##
+ Roles13.$trModule
+ $tc'MkWrap2
+ 1#
+ krep8
diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr
index 61d0a597d1..44e0ecb28e 100644
--- a/testsuite/tests/roles/should_compile/Roles14.stderr
+++ b/testsuite/tests/roles/should_compile/Roles14.stderr
@@ -20,10 +20,6 @@ Roles12.$tcC2
(GHC.Types.TrNameS "C2"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [])
Roles12.$tc'C:C2
= GHC.Types.TyCon
7087988437584478859##
@@ -32,12 +28,13 @@ Roles12.$tc'C:C2
(GHC.Types.TrNameS "'C:C2"#)
1
krep
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0) (GHC.Types.KindRepVar 0))
- (GHC.Types.KindRepTyConApp
- Roles12.$tcC2 ((:) (GHC.Types.KindRepVar 0) []))
+ = GHC.Types.KindRepTyConApp Roles12.$tcC2 ((:) krep [])
Roles12.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles12"#)
diff --git a/testsuite/tests/roles/should_compile/Roles2.stderr b/testsuite/tests/roles/should_compile/Roles2.stderr
index 7a795a3fa6..737d215195 100644
--- a/testsuite/tests/roles/should_compile/Roles2.stderr
+++ b/testsuite/tests/roles/should_compile/Roles2.stderr
@@ -19,10 +19,6 @@ Roles2.$tcT2
(GHC.Types.TrNameS "T2"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
Roles2.$tc'K2
= GHC.Types.TyCon
17395957229042313563##
@@ -31,12 +27,6 @@ Roles2.$tc'K2
(GHC.Types.TrNameS "'K2"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTyConApp
- GHC.Ptr.$tcFunPtr ((:) (GHC.Types.KindRepVar 0) []))
- (GHC.Types.KindRepTyConApp
- Roles2.$tcT2 ((:) (GHC.Types.KindRepVar 0) []))
Roles2.$tcT1
= GHC.Types.TyCon
10310640733256438505##
@@ -45,10 +35,6 @@ Roles2.$tcT1
(GHC.Types.TrNameS "T1"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
Roles2.$tc'K1
= GHC.Types.TyCon
16530009231990968394##
@@ -57,12 +43,19 @@ Roles2.$tc'K1
(GHC.Types.TrNameS "'K1"#)
1
krep
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp GHC.Ptr.$tcFunPtr ((:) krep [])
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles2.$tcT2 ((:) krep [])
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp GHC.Types.$tcIO ((:) krep [])
krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTyConApp
- GHC.Types.$tcIO ((:) (GHC.Types.KindRepVar 0) []))
- (GHC.Types.KindRepTyConApp
- Roles2.$tcT1 ((:) (GHC.Types.KindRepVar 0) []))
+ = GHC.Types.KindRepTyConApp Roles2.$tcT1 ((:) krep [])
Roles2.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles2"#)
diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr
index 5d3c38c355..e4ec97ab4d 100644
--- a/testsuite/tests/roles/should_compile/Roles3.stderr
+++ b/testsuite/tests/roles/should_compile/Roles3.stderr
@@ -41,12 +41,6 @@ Roles3.$tcC4
(GHC.Types.TrNameS "C4"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint []))
Roles3.$tcC3
= GHC.Types.TyCon
5076086601454991970##
@@ -55,12 +49,6 @@ Roles3.$tcC3
(GHC.Types.TrNameS "C3"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint []))
Roles3.$tcC2
= GHC.Types.TyCon
7902873224172523979##
@@ -69,12 +57,6 @@ Roles3.$tcC2
(GHC.Types.TrNameS "C2"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint []))
Roles3.$tc'C:C2
= GHC.Types.TyCon
11218882737915989529##
@@ -83,19 +65,6 @@ Roles3.$tc'C:C2
(GHC.Types.TrNameS "'C:C2"#)
2
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTyConApp
- Data.Type.Equality.$tc~
- ((:)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- ((:) (GHC.Types.KindRepVar 0) ((:) (GHC.Types.KindRepVar 1) []))))
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0) (GHC.Types.KindRepVar 1)))
- (GHC.Types.KindRepTyConApp
- Roles3.$tcC2
- ((:) (GHC.Types.KindRepVar 0) ((:) (GHC.Types.KindRepVar 1) [])))
Roles3.$tcC1
= GHC.Types.TyCon
11013585501375994163##
@@ -104,10 +73,6 @@ Roles3.$tcC1
(GHC.Types.TrNameS "C1"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [])
Roles3.$tc'C:C1
= GHC.Types.TyCon
4508088879886988796##
@@ -116,12 +81,23 @@ Roles3.$tc'C:C1
(GHC.Types.TrNameS "'C:C1"#)
1
krep
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 1
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp
+ Data.Type.Equality.$tc~ ((:) krep ((:) krep ((:) krep [])))
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles3.$tcC2 ((:) krep ((:) krep []))
+krep [InlPrag=[~]] = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0) (GHC.Types.KindRepVar 0))
- (GHC.Types.KindRepTyConApp
- Roles3.$tcC1 ((:) (GHC.Types.KindRepVar 0) []))
+ = GHC.Types.KindRepTyConApp Roles3.$tcC1 ((:) krep [])
Roles3.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles3"#)
diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr
index 989d77a9d6..de95825009 100644
--- a/testsuite/tests/roles/should_compile/Roles4.stderr
+++ b/testsuite/tests/roles/should_compile/Roles4.stderr
@@ -26,10 +26,6 @@ Roles4.$tcC3
(GHC.Types.TrNameS "C3"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [])
Roles4.$tc'C:C3
= GHC.Types.TyCon
3133378316178104365##
@@ -38,14 +34,6 @@ Roles4.$tc'C:C3
(GHC.Types.TrNameS "'C:C3"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepTyConApp
- GHC.Types.$tc[] ((:) (GHC.Types.KindRepVar 0) [])))
- (GHC.Types.KindRepTyConApp
- Roles4.$tcC3 ((:) (GHC.Types.KindRepVar 0) []))
Roles4.$tcC1
= GHC.Types.TyCon
13392243382482428602##
@@ -54,10 +42,6 @@ Roles4.$tcC1
(GHC.Types.TrNameS "C1"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [])
Roles4.$tc'C:C1
= GHC.Types.TyCon
3870707671502302648##
@@ -66,12 +50,19 @@ Roles4.$tc'C:C1
(GHC.Types.TrNameS "'C:C1"#)
1
krep
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp GHC.Types.$tc[] ((:) krep [])
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp Roles4.$tcC3 ((:) krep [])
krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0) (GHC.Types.KindRepVar 0))
- (GHC.Types.KindRepTyConApp
- Roles4.$tcC1 ((:) (GHC.Types.KindRepVar 0) []))
+ = GHC.Types.KindRepTyConApp Roles4.$tcC1 ((:) krep [])
Roles4.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles4"#)
diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr
index 52bfa274c9..a259f7067a 100644
--- a/testsuite/tests/roles/should_compile/T8958.stderr
+++ b/testsuite/tests/roles/should_compile/T8958.stderr
@@ -28,12 +28,6 @@ T8958.$tcMap
(GHC.Types.TrNameS "Map"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep))
T8958.$tc'MkMap
= GHC.Types.TyCon
2942839876828444488##
@@ -42,24 +36,6 @@ T8958.$tc'MkMap
(GHC.Types.TrNameS "'MkMap"#)
2
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTyConApp
- GHC.Types.$tc[]
- ((:) @ GHC.Types.KindRep
- (GHC.Types.KindRepTyConApp
- GHC.Tuple.$tc(,)
- ((:) @ GHC.Types.KindRep
- (GHC.Types.KindRepVar 0)
- ((:) @ GHC.Types.KindRep
- (GHC.Types.KindRepVar 1) [] @ GHC.Types.KindRep)))
- [] @ GHC.Types.KindRep))
- (GHC.Types.KindRepTyConApp
- T8958.$tcMap
- ((:) @ GHC.Types.KindRep
- (GHC.Types.KindRepVar 0)
- ((:) @ GHC.Types.KindRep
- (GHC.Types.KindRepVar 1) [] @ GHC.Types.KindRep)))
T8958.$tcRepresentational
= GHC.Types.TyCon
12809567151893673426##
@@ -68,11 +44,6 @@ T8958.$tcRepresentational
(GHC.Types.TrNameS "Representational"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp
- GHC.Types.$tcConstraint [] @ GHC.Types.KindRep)
T8958.$tc'C:Representational
= GHC.Types.TyCon
2358772282532242424##
@@ -81,11 +52,6 @@ T8958.$tc'C:Representational
(GHC.Types.TrNameS "'C:Representational"#)
1
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepTyConApp
- T8958.$tcRepresentational
- ((:) @ GHC.Types.KindRep
- (GHC.Types.KindRepVar 0) [] @ GHC.Types.KindRep)
T8958.$tcNominal
= GHC.Types.TyCon
12224997609886144634##
@@ -94,11 +60,6 @@ T8958.$tcNominal
(GHC.Types.TrNameS "Nominal"#)
0
krep
-krep [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
- (GHC.Types.KindRepTyConApp
- GHC.Types.$tcConstraint [] @ GHC.Types.KindRep)
T8958.$tc'C:Nominal
= GHC.Types.TyCon
10562260635335201742##
@@ -107,11 +68,34 @@ T8958.$tc'C:Nominal
(GHC.Types.TrNameS "'C:Nominal"#)
1
krep
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep [InlPrag=[~]] = GHC.Types.KindRepVar 1
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
+krep [InlPrag=[~]] = GHC.Types.KindRepFun krep krep
krep [InlPrag=[~]]
= GHC.Types.KindRepTyConApp
- T8958.$tcNominal
+ GHC.Tuple.$tc(,)
+ ((:) @ GHC.Types.KindRep
+ krep ((:) @ GHC.Types.KindRep krep [] @ GHC.Types.KindRep))
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp
+ T8958.$tcMap
((:) @ GHC.Types.KindRep
- (GHC.Types.KindRepVar 0) [] @ GHC.Types.KindRep)
+ krep ((:) @ GHC.Types.KindRep krep [] @ GHC.Types.KindRep))
+krep [InlPrag=[~]] = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp
+ GHC.Types.$tc[]
+ ((:) @ GHC.Types.KindRep krep [] @ GHC.Types.KindRep)
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp
+ T8958.$tcRepresentational
+ ((:) @ GHC.Types.KindRep krep [] @ GHC.Types.KindRep)
+krep [InlPrag=[~]]
+ = GHC.Types.KindRepTyConApp
+ T8958.$tcNominal
+ ((:) @ GHC.Types.KindRep krep [] @ GHC.Types.KindRep)
T8958.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "T8958"#)
diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr
index bf2c6df607..862cf34fa7 100644
--- a/testsuite/tests/simplCore/should_compile/T7360.stderr
+++ b/testsuite/tests/simplCore/should_compile/T7360.stderr
@@ -1,7 +1,7 @@
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 125, types: 58, coercions: 0, joins: 0/0}
+ = {terms: 117, types: 54, coercions: 0, joins: 0/0}
-- RHS size: {terms: 6, types: 3, coercions: 0, joins: 0/0}
T7360.$WFoo3 [InlPrag=INLINE] :: Int -> Foo
@@ -14,9 +14,9 @@ T7360.$WFoo3 [InlPrag=INLINE] :: Int -> Foo
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (dt [Occ=Once!] :: Int) ->
case dt of { GHC.Types.I# dt [Occ=Once] -> T7360.Foo3 dt }}]
-T7360.$WFoo3 =
- \ (dt [Occ=Once!] :: Int) ->
- case dt of { GHC.Types.I# dt [Occ=Once] -> T7360.Foo3 dt }
+T7360.$WFoo3
+ = \ (dt [Occ=Once!] :: Int) ->
+ case dt of { GHC.Types.I# dt [Occ=Once] -> T7360.Foo3 dt }
-- RHS size: {terms: 5, types: 2, coercions: 0, joins: 0/0}
fun1 [InlPrag=NOINLINE] :: Foo -> ()
@@ -64,16 +64,16 @@ fun2 :: forall a. [a] -> ((), Int)
GHC.Types.I# ww2
}
})}]
-fun2 =
- \ (@ a) (x :: [a]) ->
- (T7360.fun5,
- case x of wild {
- [] -> T7360.fun4;
- : ds ds1 ->
- case GHC.List.$wlenAcc @ a wild 0# of ww2 { __DEFAULT ->
- GHC.Types.I# ww2
- }
- })
+fun2
+ = \ (@ a) (x :: [a]) ->
+ (T7360.fun5,
+ case x of wild {
+ [] -> T7360.fun4;
+ : ds ds1 ->
+ case GHC.List.$wlenAcc @ a wild 0# of ww2 { __DEFAULT ->
+ GHC.Types.I# ww2
+ }
+ })
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
T7360.$trModule4 :: GHC.Prim.Addr#
@@ -116,8 +116,15 @@ T7360.$trModule :: GHC.Types.Module
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
-T7360.$trModule =
- GHC.Types.Module T7360.$trModule3 T7360.$trModule1
+T7360.$trModule
+ = GHC.Types.Module T7360.$trModule3 T7360.$trModule1
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+krep :: GHC.Types.KindRep
+[GblId, Caf=NoCafRefs, Str=m1]
+krep
+ = GHC.Types.KindRepTyConApp
+ GHC.Types.$tcInt (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
T7360.$tcFoo1 [InlPrag=[~]] :: GHC.Types.KindRep
@@ -148,21 +155,21 @@ T7360.$tcFoo :: GHC.Types.TyCon
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
-T7360.$tcFoo =
- GHC.Types.TyCon
- 1581370841583180512##
- 13291578023368289311##
- T7360.$trModule
- T7360.$tcFoo2
- 0#
- T7360.$tcFoo1
+T7360.$tcFoo
+ = GHC.Types.TyCon
+ 1581370841583180512##
+ 13291578023368289311##
+ T7360.$trModule
+ T7360.$tcFoo2
+ 0#
+ T7360.$tcFoo1
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
T7360.$tc'Foo4 [InlPrag=[~]] :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs, Str=m1]
-T7360.$tc'Foo4 =
- GHC.Types.KindRepTyConApp
- T7360.$tcFoo (GHC.Types.[] @ GHC.Types.KindRep)
+T7360.$tc'Foo4
+ = GHC.Types.KindRepTyConApp
+ T7360.$tcFoo (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
T7360.$tc'Foo6 :: GHC.Prim.Addr#
@@ -188,38 +195,31 @@ T7360.$tc'Foo1 :: GHC.Types.TyCon
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
-T7360.$tc'Foo1 =
- GHC.Types.TyCon
- 3986951253261644518##
- 2515097940992351150##
- T7360.$trModule
- T7360.$tc'Foo5
- 0#
- T7360.$tc'Foo4
-
--- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
-T7360.$tc'Foo7 [InlPrag=[~]] :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs, Str=m1]
-T7360.$tc'Foo7 =
- GHC.Types.KindRepTyConApp
- T7360.$tcFoo (GHC.Types.[] @ GHC.Types.KindRep)
+T7360.$tc'Foo1
+ = GHC.Types.TyCon
+ 3986951253261644518##
+ 2515097940992351150##
+ T7360.$trModule
+ T7360.$tc'Foo5
+ 0#
+ T7360.$tc'Foo4
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
-T7360.$tc'Foo9 :: GHC.Prim.Addr#
+T7360.$tc'Foo8 :: GHC.Prim.Addr#
[GblId,
Caf=NoCafRefs,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}]
-T7360.$tc'Foo9 = "'Foo2"#
+T7360.$tc'Foo8 = "'Foo2"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-T7360.$tc'Foo8 :: GHC.Types.TrName
+T7360.$tc'Foo7 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
-T7360.$tc'Foo8 = GHC.Types.TrNameS T7360.$tc'Foo9
+T7360.$tc'Foo7 = GHC.Types.TrNameS T7360.$tc'Foo8
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
T7360.$tc'Foo2 :: GHC.Types.TyCon
@@ -228,65 +228,52 @@ T7360.$tc'Foo2 :: GHC.Types.TyCon
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
-T7360.$tc'Foo2 =
- GHC.Types.TyCon
- 17325079864060690428##
- 2969742457748208427##
- T7360.$trModule
- T7360.$tc'Foo8
- 0#
- T7360.$tc'Foo7
-
--- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
-krep :: GHC.Types.KindRep
-[GblId, Str=m1]
-krep =
- GHC.Types.KindRepTyConApp
- GHC.Types.$tcInt (GHC.Types.[] @ GHC.Types.KindRep)
-
--- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
-krep1 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs, Str=m1]
-krep1 =
- GHC.Types.KindRepTyConApp
- T7360.$tcFoo (GHC.Types.[] @ GHC.Types.KindRep)
+T7360.$tc'Foo2
+ = GHC.Types.TyCon
+ 17325079864060690428##
+ 2969742457748208427##
+ T7360.$trModule
+ T7360.$tc'Foo7
+ 0#
+ T7360.$tc'Foo4
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-T7360.$tc'Foo10 [InlPrag=[~]] :: GHC.Types.KindRep
-[GblId, Str=m4]
-T7360.$tc'Foo10 = GHC.Types.KindRepFun krep krep1
+T7360.$tc'Foo9 [InlPrag=[~]] :: GHC.Types.KindRep
+[GblId, Caf=NoCafRefs, Str=m4]
+T7360.$tc'Foo9 = GHC.Types.KindRepFun krep T7360.$tc'Foo4
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
-T7360.$tc'Foo12 :: GHC.Prim.Addr#
+T7360.$tc'Foo11 :: GHC.Prim.Addr#
[GblId,
Caf=NoCafRefs,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}]
-T7360.$tc'Foo12 = "'Foo3"#
+T7360.$tc'Foo11 = "'Foo3"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-T7360.$tc'Foo11 :: GHC.Types.TrName
+T7360.$tc'Foo10 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
-T7360.$tc'Foo11 = GHC.Types.TrNameS T7360.$tc'Foo12
+T7360.$tc'Foo10 = GHC.Types.TrNameS T7360.$tc'Foo11
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
T7360.$tc'Foo3 :: GHC.Types.TyCon
[GblId,
+ Caf=NoCafRefs,
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}]
-T7360.$tc'Foo3 =
- GHC.Types.TyCon
- 3674231676522181654##
- 2694749919371021431##
- T7360.$trModule
- T7360.$tc'Foo11
- 0#
- T7360.$tc'Foo10
+T7360.$tc'Foo3
+ = GHC.Types.TyCon
+ 3674231676522181654##
+ 2694749919371021431##
+ T7360.$trModule
+ T7360.$tc'Foo10
+ 0#
+ T7360.$tc'Foo9
diff --git a/testsuite/tests/simplCore/should_compile/T8274.stdout b/testsuite/tests/simplCore/should_compile/T8274.stdout
index 90d5cebefb..7773b13515 100644
--- a/testsuite/tests/simplCore/should_compile/T8274.stdout
+++ b/testsuite/tests/simplCore/should_compile/T8274.stdout
@@ -4,14 +4,14 @@ T8274.$trModule4 :: Addr#
T8274.$trModule4 = "main"#
T8274.$trModule2 :: Addr#
T8274.$trModule2 = "T8274"#
-T8274.$tcP3 :: Addr#
-T8274.$tcP3 = "P"#
-T8274.$tcP = GHC.Types.TyCon 7483823267324216774## 12197132127820124256## T8274.$trModule T8274.$tcP2 0# T8274.$tcP1
-krep = GHC.Types.KindRepTyConApp GHC.Types.$tcInt# (GHC.Types.[] @ GHC.Types.KindRep)
-krep1 = GHC.Types.KindRepTyConApp GHC.Types.$tcFloat# (GHC.Types.[] @ GHC.Types.KindRep)
+krep = GHC.Types.KindRepTyConApp GHC.Types.$tcWord# (GHC.Types.[] @ GHC.Types.KindRep)
+krep1 = GHC.Types.KindRepTyConApp GHC.Types.$tcChar# (GHC.Types.[] @ GHC.Types.KindRep)
krep2 = GHC.Types.KindRepTyConApp GHC.Types.$tcDouble# (GHC.Types.[] @ GHC.Types.KindRep)
-krep3 = GHC.Types.KindRepTyConApp GHC.Types.$tcChar# (GHC.Types.[] @ GHC.Types.KindRep)
-krep4 = GHC.Types.KindRepTyConApp GHC.Types.$tcWord# (GHC.Types.[] @ GHC.Types.KindRep)
+krep3 = GHC.Types.KindRepTyConApp GHC.Types.$tcFloat# (GHC.Types.[] @ GHC.Types.KindRep)
+krep4 = GHC.Types.KindRepTyConApp GHC.Types.$tcInt# (GHC.Types.[] @ GHC.Types.KindRep)
+T8274.$tcP2 :: Addr#
+T8274.$tcP2 = "P"#
+T8274.$tcP = GHC.Types.TyCon 7483823267324216774## 12197132127820124256## T8274.$trModule T8274.$tcP1 0# T8274.$tcN1
T8274.$tc'Positives3 :: Addr#
T8274.$tc'Positives3 = "'Positives"#
= GHC.Types.TyCon 14886798270706315033## 15735393004803600911## T8274.$trModule T8274.$tc'Positives2 0# T8274.$tc'Positives1
diff --git a/testsuite/tests/th/TH_Roles2.stderr b/testsuite/tests/th/TH_Roles2.stderr
index 30279111c3..b041046cb9 100644
--- a/testsuite/tests/th/TH_Roles2.stderr
+++ b/testsuite/tests/th/TH_Roles2.stderr
@@ -16,11 +16,10 @@ TH_Roles2.$tcT
TH_Roles2.$trModule
(GHC.Types.TrNameS "T"#)
1
- krep_a4im
-krep_a4im [InlPrag=[~]]
- = GHC.Types.KindRepFun
- (GHC.Types.KindRepVar 0)
- (GHC.Types.KindRepTYPE GHC.Types.LiftedRep)
+ krep_a4bG
+krep_a4bH [InlPrag=[~]] = GHC.Types.KindRepVar 0
+krep_a4bG [InlPrag=[~]] = GHC.Types.KindRepFun krep_a4bH krep_a4bI
+krep_a4bI [InlPrag=[~]] = GHC.Types.KindRepTYPE GHC.Types.LiftedRep
TH_Roles2.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "TH_Roles2"#)