Commit a07f46ea authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Matthew Pickering

Remove tcTyConUserTyVars

The tcTyConUserTyVars field of TcTyCon was entirely unused.

This patch kills it off entirely.
parent 473632d7
...@@ -1835,7 +1835,7 @@ kcLHsQTyVars_Cusk, kcLHsQTyVars_NonCusk ...@@ -1835,7 +1835,7 @@ kcLHsQTyVars_Cusk, kcLHsQTyVars_NonCusk
------------------------------ ------------------------------
kcLHsQTyVars_Cusk name flav kcLHsQTyVars_Cusk name flav
user_tyvars@(HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns (HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns
, hsq_dependent = dep_names } , hsq_dependent = dep_names }
, hsq_explicit = hs_tvs }) thing_inside , hsq_explicit = hs_tvs }) thing_inside
-- CUSK case -- CUSK case
...@@ -1876,7 +1876,7 @@ kcLHsQTyVars_Cusk name flav ...@@ -1876,7 +1876,7 @@ kcLHsQTyVars_Cusk name flav
++ map (mkRequiredTyConBinder mentioned_kv_set) tc_tvs ++ map (mkRequiredTyConBinder mentioned_kv_set) tc_tvs
all_tv_prs = mkTyVarNamePairs (scoped_kvs ++ tc_tvs) all_tv_prs = mkTyVarNamePairs (scoped_kvs ++ tc_tvs)
tycon = mkTcTyCon name (ppr user_tyvars) tycon = mkTcTyCon name
final_tc_binders final_tc_binders
res_kind res_kind
all_tv_prs all_tv_prs
...@@ -1918,7 +1918,7 @@ kcLHsQTyVars_Cusk _ _ (XLHsQTyVars _) _ = panic "kcLHsQTyVars" ...@@ -1918,7 +1918,7 @@ kcLHsQTyVars_Cusk _ _ (XLHsQTyVars _) _ = panic "kcLHsQTyVars"
------------------------------ ------------------------------
kcLHsQTyVars_NonCusk name flav kcLHsQTyVars_NonCusk name flav
user_tyvars@(HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns (HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns
, hsq_dependent = dep_names } , hsq_dependent = dep_names }
, hsq_explicit = hs_tvs }) thing_inside , hsq_explicit = hs_tvs }) thing_inside
-- Non_CUSK case -- Non_CUSK case
...@@ -1940,7 +1940,7 @@ kcLHsQTyVars_NonCusk name flav ...@@ -1940,7 +1940,7 @@ kcLHsQTyVars_NonCusk name flav
-- Also, note that tc_binders has the tyvars from only the -- Also, note that tc_binders has the tyvars from only the
-- user-written tyvarbinders. See S1 in Note [How TcTyCons work] -- user-written tyvarbinders. See S1 in Note [How TcTyCons work]
-- in TcTyClsDecls -- in TcTyClsDecls
tycon = mkTcTyCon name (ppr user_tyvars) tc_binders res_kind tycon = mkTcTyCon name tc_binders res_kind
(mkTyVarNamePairs (scoped_kvs ++ tc_tvs)) (mkTyVarNamePairs (scoped_kvs ++ tc_tvs))
False -- not yet generalised False -- not yet generalised
flav flav
......
...@@ -540,7 +540,6 @@ generaliseTcTyCon tc ...@@ -540,7 +540,6 @@ generaliseTcTyCon tc
tc_flav = tyConFlavour tc tc_flav = tyConFlavour tc
tc_res_kind = tyConResKind tc tc_res_kind = tyConResKind tc
tc_tvs = tyConTyVars tc tc_tvs = tyConTyVars tc
user_tyvars = tcTyConUserTyVars tc -- ToDo: nuke
(scoped_tv_names, scoped_tvs) = unzip (tcTyConScopedTyVars tc) (scoped_tv_names, scoped_tvs) = unzip (tcTyConScopedTyVars tc)
-- NB: scoped_tvs includes both specified and required (tc_tvs) -- NB: scoped_tvs includes both specified and required (tc_tvs)
...@@ -596,7 +595,7 @@ generaliseTcTyCon tc ...@@ -596,7 +595,7 @@ generaliseTcTyCon tc
scoped_tv_pairs = scoped_tv_names `zip` scoped_tvs scoped_tv_pairs = scoped_tv_names `zip` scoped_tvs
-- Step 7: Make the result TcTyCon -- Step 7: Make the result TcTyCon
tycon = mkTcTyCon tc_name user_tyvars final_tcbs tc_res_kind tycon = mkTcTyCon tc_name final_tcbs tc_res_kind
scoped_tv_pairs scoped_tv_pairs
True {- it's generalised now -} True {- it's generalised now -}
(tyConFlavour tc) (tyConFlavour tc)
...@@ -1497,7 +1496,6 @@ tcFamDecl1 :: Maybe Class -> FamilyDecl GhcRn -> TcM TyCon ...@@ -1497,7 +1496,6 @@ tcFamDecl1 :: Maybe Class -> FamilyDecl GhcRn -> TcM TyCon
tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
, fdLName = tc_lname@(dL->L _ tc_name) , fdLName = tc_lname@(dL->L _ tc_name)
, fdResultSig = (dL->L _ sig) , fdResultSig = (dL->L _ sig)
, fdTyVars = user_tyvars
, fdInjectivityAnn = inj }) , fdInjectivityAnn = inj })
| DataFamily <- fam_info | DataFamily <- fam_info
= bindTyClTyVars tc_name $ \ binders res_kind -> do = bindTyClTyVars tc_name $ \ binders res_kind -> do
...@@ -1559,7 +1557,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info ...@@ -1559,7 +1557,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info
Just eqns -> do { Just eqns -> do {
-- Process the equations, creating CoAxBranches -- Process the equations, creating CoAxBranches
; let tc_fam_tc = mkTcTyCon tc_name (ppr user_tyvars) binders res_kind ; let tc_fam_tc = mkTcTyCon tc_name binders res_kind
[] False {- this doesn't matter here -} [] False {- this doesn't matter here -}
ClosedTypeFamilyFlavour ClosedTypeFamilyFlavour
......
...@@ -99,7 +99,7 @@ module TyCon( ...@@ -99,7 +99,7 @@ module TyCon(
algTcFields, algTcFields,
tyConRuntimeRepInfo, tyConRuntimeRepInfo,
tyConBinders, tyConResKind, tyConTyVarBinders, tyConBinders, tyConResKind, tyConTyVarBinders,
tcTyConScopedTyVars, tcTyConUserTyVars, tcTyConIsPoly, tcTyConScopedTyVars, tcTyConIsPoly,
mkTyConTagMap, mkTyConTagMap,
-- ** Manipulating TyCons -- ** Manipulating TyCons
...@@ -861,7 +861,6 @@ data TyCon ...@@ -861,7 +861,6 @@ data TyCon
-- without a CUSK, it's the original left-to-right -- without a CUSK, it's the original left-to-right
-- that the user wrote. Nec'y for getting Specified -- that the user wrote. Nec'y for getting Specified
-- variables in the right order. -- variables in the right order.
tcTyConUserTyVars :: SDoc, -- ^ Original, user-written tycon tyvars
tcTyConIsPoly :: Bool, -- ^ Is this TcTyCon already generalized? tcTyConIsPoly :: Bool, -- ^ Is this TcTyCon already generalized?
tcTyConFlavour :: TyConFlavour tcTyConFlavour :: TyConFlavour
...@@ -1583,7 +1582,6 @@ mkSumTyCon name binders res_kind arity tyvars cons parent ...@@ -1583,7 +1582,6 @@ mkSumTyCon name binders res_kind arity tyvars cons parent
-- See also Note [Kind checking recursive type and class declarations] -- See also Note [Kind checking recursive type and class declarations]
-- in TcTyClsDecls. -- in TcTyClsDecls.
mkTcTyCon :: Name mkTcTyCon :: Name
-> SDoc -- ^ user-written tycon tyvars
-> [TyConBinder] -> [TyConBinder]
-> Kind -- ^ /result/ kind only -> Kind -- ^ /result/ kind only
-> [(Name,TcTyVar)] -- ^ Scoped type variables; -> [(Name,TcTyVar)] -- ^ Scoped type variables;
...@@ -1591,7 +1589,7 @@ mkTcTyCon :: Name ...@@ -1591,7 +1589,7 @@ mkTcTyCon :: Name
-> Bool -- ^ Is this TcTyCon generalised already? -> Bool -- ^ Is this TcTyCon generalised already?
-> TyConFlavour -- ^ What sort of 'TyCon' this represents -> TyConFlavour -- ^ What sort of 'TyCon' this represents
-> TyCon -> TyCon
mkTcTyCon name tyvars binders res_kind scoped_tvs poly flav mkTcTyCon name binders res_kind scoped_tvs poly flav
= TcTyCon { tyConUnique = getUnique name = TcTyCon { tyConUnique = getUnique name
, tyConName = name , tyConName = name
, tyConTyVars = binderVars binders , tyConTyVars = binderVars binders
...@@ -1601,8 +1599,7 @@ mkTcTyCon name tyvars binders res_kind scoped_tvs poly flav ...@@ -1601,8 +1599,7 @@ mkTcTyCon name tyvars binders res_kind scoped_tvs poly flav
, tyConArity = length binders , tyConArity = length binders
, tcTyConScopedTyVars = scoped_tvs , tcTyConScopedTyVars = scoped_tvs
, tcTyConIsPoly = poly , tcTyConIsPoly = poly
, tcTyConFlavour = flav , tcTyConFlavour = flav }
, tcTyConUserTyVars = tyvars }
-- | Create an unlifted primitive 'TyCon', such as @Int#@. -- | Create an unlifted primitive 'TyCon', such as @Int#@.
mkPrimTyCon :: Name -> [TyConBinder] mkPrimTyCon :: Name -> [TyConBinder]
...@@ -1719,7 +1716,7 @@ isAbstractTyCon _ = False ...@@ -1719,7 +1716,7 @@ isAbstractTyCon _ = False
-- Used when recovering from errors -- Used when recovering from errors
makeRecoveryTyCon :: TyCon -> TyCon makeRecoveryTyCon :: TyCon -> TyCon
makeRecoveryTyCon tc makeRecoveryTyCon tc
= mkTcTyCon (tyConName tc) empty = mkTcTyCon (tyConName tc)
(tyConBinders tc) (tyConResKind tc) (tyConBinders tc) (tyConResKind tc)
[{- no scoped vars -}] [{- no scoped vars -}]
True True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment