diff options
-rw-r--r-- | compiler/coreSyn/TrieMap.hs | 28 | ||||
-rw-r--r-- | compiler/typecheck/TcTypeable.hs | 259 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_compile/T2431.stderr | 47 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr | 104 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 9 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles1.stderr | 101 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles13.stderr | 85 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles14.stderr | 15 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles2.stderr | 31 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles3.stderr | 56 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles4.stderr | 33 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/T8958.stderr | 66 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T7360.stderr | 61 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T8274.stdout | 14 | ||||
-rw-r--r-- | testsuite/tests/th/TH_Roles2.stderr | 11 |
15 files changed, 414 insertions, 506 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 b635c196e6..875296ec78 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,12 @@ 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 +299,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 +373,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 +419,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 +617,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 2993e15d95..1fd5b44d86 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[2]] :: forall a. a :~: 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# @@ -92,34 +87,24 @@ T2431.$tc:~: 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# + $krep2 -- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} -$krep7 :: [GHC.Types.KindRep] +$krep4 :: [GHC.Types.KindRep] [GblId, Caf=NoCafRefs] -$krep7 +$krep4 = GHC.Types.: - @ GHC.Types.KindRep $krep6 (GHC.Types.[] @ GHC.Types.KindRep) + @ 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# @@ -141,7 +126,7 @@ T2431.$tc'Refl T2431.$trModule $tc'Refl2 1# - $krep9 + $krep6 diff --git a/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr b/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr index 61ce1ae439..fe79f2b6f3 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 b1f7fbe545..5a87bd5632 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -429,7 +429,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), 1065147968, 5)]), # expected value: 774595008 (amd64/Linux): # expected value: 735486328 (amd64/Linux) 2012/12/12: # expected value: 690742040 (amd64/Linux) Call Arity improvements @@ -442,6 +442,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-03-03: 1065147968 (amd64/Linux) Share Typeable KindReps only_ways(['normal']) ], compile, @@ -823,7 +824,7 @@ test('T9872c', test('T9872d', [ only_ways(['normal']), compiler_stats_num_field('bytes allocated', - [(wordsize(64), 498855104, 5), + [(wordsize(64), 462817352, 5), # 2014-12-18 796071864 Initally created # 2014-12-18 739189056 Reduce type families even more eagerly # 2015-01-07 687562440 TrieMap leaf compression @@ -835,6 +836,7 @@ test('T9872d', # a 1% improvement 482 -> 478 # 2017-02-17 535565128 Type-indexed Typeable # 2017-02-25 498855104 Early inlining + # 2017-03-03 462817352 Share Typeable KindReps (wordsize(32), 264566040, 5) # some date 328810212 @@ -964,10 +966,11 @@ test('T12227', test('T12425', [ only_ways(['optasm']), compiler_stats_num_field('bytes allocated', - [(wordsize(64), 153611448, 5), + [(wordsize(64), 142256192, 5), # initial: 125831400 # 2017-01-18: 133380960 Allow top-level string literals in Core # 2017-02-17: 153611448 Type-indexed Typeable + # 2017-03-03: 142256192 Share Typeable KindReps ]), ], compile, diff --git a/testsuite/tests/roles/should_compile/Roles1.stderr b/testsuite/tests/roles/should_compile/Roles1.stderr index 574750ce44..ae4570ab47 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 1ea545504b..6a5e31d9c5 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 @@ -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] -$krep = GHC.Types.KindRepTYPE GHC.Types.LiftedRep +$krep2 = GHC.Types.KindRepFun $krep1 $krep1 + +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +$krep3 :: GHC.Types.KindRep +[GblId, Caf=NoCafRefs] +$krep3 = GHC.Types.KindRepVar 0# -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $tcAge1 :: GHC.Prim.Addr# @@ -66,26 +83,19 @@ Roles13.$tcAge Roles13.$trModule $tcAge2 0# - $krep - --- 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) + $krep1 -- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} -$krep2 :: GHC.Types.KindRep +$krep4 :: GHC.Types.KindRep [GblId, Caf=NoCafRefs] -$krep2 +$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# @@ -107,22 +117,7 @@ Roles13.$tc'MkAge 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 + $krep5 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $tcWrap1 :: GHC.Prim.Addr# @@ -144,34 +139,24 @@ Roles13.$tcWrap 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# + $krep2 -- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} -$krep9 :: [GHC.Types.KindRep] +$krep6 :: [GHC.Types.KindRep] [GblId, Caf=NoCafRefs] -$krep9 +$krep6 = GHC.Types.: - @ GHC.Types.KindRep $krep8 (GHC.Types.[] @ GHC.Types.KindRep) + @ 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# @@ -193,7 +178,7 @@ Roles13.$tc'MkWrap Roles13.$trModule $tc'MkWrap2 1# - $krep11 + $krep8 diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr index 15f61ce9fd..08ca28fecc 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 39ca1ea0a8..b96d17330a 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 af9bc168c7..7f9f1a39d9 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 389379bad2..205a4d5714 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 5939c69954..22cc6ca7b7 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 89ea2e7d8f..22a7a64d92 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[2]] :: Int -> Foo @@ -119,6 +119,13 @@ T7360.$trModule :: GHC.Types.Module 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 [GblId, Caf=NoCafRefs, Str=m5] @@ -197,29 +204,22 @@ T7360.$tc'Foo1 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) - -- 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 @@ -233,49 +233,36 @@ T7360.$tc'Foo2 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) + 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}] @@ -284,9 +271,9 @@ T7360.$tc'Foo3 3674231676522181654## 2694749919371021431## T7360.$trModule - T7360.$tc'Foo11 - 0# 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 a64980e51a..a8e7954f1a 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 54841e7774..37dcbaa3b5 100644 --- a/testsuite/tests/th/TH_Roles2.stderr +++ b/testsuite/tests/th/TH_Roles2.stderr @@ -16,11 +16,12 @@ TH_Roles2.$tcT TH_Roles2.$trModule (GHC.Types.TrNameS "T"#) 1 - $krep_a40L -$krep_a40L [InlPrag=[~]] - = GHC.Types.KindRepFun - (GHC.Types.KindRepVar 0) - (GHC.Types.KindRepTYPE GHC.Types.LiftedRep) + $krep_a3U5 +$krep_a3U6 [InlPrag=[~]] = GHC.Types.KindRepVar 0 +$krep_a3U5 [InlPrag=[~]] + = GHC.Types.KindRepFun $krep_a3U6 $krep_a3U7 +$krep_a3U7 [InlPrag=[~]] + = GHC.Types.KindRepTYPE GHC.Types.LiftedRep TH_Roles2.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "TH_Roles2"#) |