diff options
Diffstat (limited to 'compiler/backpack')
-rw-r--r-- | compiler/backpack/BkpSyn.hs | 2 | ||||
-rw-r--r-- | compiler/backpack/DriverBkp.hs | 2 | ||||
-rw-r--r-- | compiler/backpack/NameShape.hs | 2 | ||||
-rw-r--r-- | compiler/backpack/RnModIface.hs | 48 |
4 files changed, 36 insertions, 18 deletions
diff --git a/compiler/backpack/BkpSyn.hs b/compiler/backpack/BkpSyn.hs index 842c0df49d..67905c6067 100644 --- a/compiler/backpack/BkpSyn.hs +++ b/compiler/backpack/BkpSyn.hs @@ -17,6 +17,8 @@ module BkpSyn ( LRenaming, Renaming(..), ) where +import GhcPrelude + import HsSyn import SrcLoc import Outputable diff --git a/compiler/backpack/DriverBkp.hs b/compiler/backpack/DriverBkp.hs index 4324e5763b..7784df2ff5 100644 --- a/compiler/backpack/DriverBkp.hs +++ b/compiler/backpack/DriverBkp.hs @@ -18,6 +18,8 @@ module DriverBkp (doBackpack) where #include "HsVersions.h" +import GhcPrelude + -- In a separate module because it hooks into the parser. import BkpSyn diff --git a/compiler/backpack/NameShape.hs b/compiler/backpack/NameShape.hs index 6ec243ef20..a1a0b1893b 100644 --- a/compiler/backpack/NameShape.hs +++ b/compiler/backpack/NameShape.hs @@ -12,6 +12,8 @@ module NameShape( #include "HsVersions.h" +import GhcPrelude + import Outputable import HscTypes import Module diff --git a/compiler/backpack/RnModIface.hs b/compiler/backpack/RnModIface.hs index 2e738c1ec6..3ae01d72b8 100644 --- a/compiler/backpack/RnModIface.hs +++ b/compiler/backpack/RnModIface.hs @@ -15,6 +15,8 @@ module RnModIface( #include "HsVersions.h" +import GhcPrelude + import SrcLoc import Outputable import HscTypes @@ -106,7 +108,6 @@ rnModIface hsc_env insts nsubst iface = do deps <- rnDependencies (mi_deps iface) -- TODO: -- mi_rules - -- mi_vect_info (LOW PRIORITY) return iface { mi_module = mod , mi_sig_of = sig_of , mi_insts = insts @@ -422,11 +423,13 @@ rnIfaceDecl d@IfaceData{} = do binders <- mapM rnIfaceTyConBinder (ifBinders d) ctxt <- mapM rnIfaceType (ifCtxt d) cons <- rnIfaceConDecls (ifCons d) + res_kind <- rnIfaceType (ifResKind d) parent <- rnIfaceTyConParent (ifParent d) return d { ifName = name , ifBinders = binders , ifCtxt = ctxt , ifCons = cons + , ifResKind = res_kind , ifParent = parent } rnIfaceDecl d@IfaceSynonym{} = do @@ -509,7 +512,7 @@ rnIfaceTyConParent :: Rename IfaceTyConParent rnIfaceTyConParent (IfDataInstance n tc args) = IfDataInstance <$> rnIfaceGlobal n <*> rnIfaceTyCon tc - <*> rnIfaceTcArgs args + <*> rnIfaceAppArgs args rnIfaceTyConParent IfNoParent = pure IfNoParent rnIfaceConDecls :: Rename IfaceConDecls @@ -521,7 +524,8 @@ rnIfaceConDecls IfAbstractTyCon = pure IfAbstractTyCon rnIfaceConDecl :: Rename IfaceConDecl rnIfaceConDecl d = do con_name <- rnIfaceGlobal (ifConName d) - con_ex_tvs <- mapM rnIfaceForAllBndr (ifConExTvs d) + con_ex_tvs <- mapM rnIfaceBndr (ifConExTCvs d) + con_user_tvbs <- mapM rnIfaceForAllBndr (ifConUserTvBinders d) let rnIfConEqSpec (n,t) = (,) n <$> rnIfaceType t con_eq_spec <- mapM rnIfConEqSpec (ifConEqSpec d) con_ctxt <- mapM rnIfaceType (ifConCtxt d) @@ -531,7 +535,8 @@ rnIfaceConDecl d = do rnIfaceBang bang = pure bang con_stricts <- mapM rnIfaceBang (ifConStricts d) return d { ifConName = con_name - , ifConExTvs = con_ex_tvs + , ifConExTCvs = con_ex_tvs + , ifConUserTvBinders = con_user_tvbs , ifConEqSpec = con_eq_spec , ifConCtxt = con_ctxt , ifConArgTys = con_arg_tys @@ -552,7 +557,7 @@ rnMaybeDefMethSpec mb = return mb rnIfaceAxBranch :: Rename IfaceAxBranch rnIfaceAxBranch d = do ty_vars <- mapM rnIfaceTvBndr (ifaxbTyVars d) - lhs <- rnIfaceTcArgs (ifaxbLHS d) + lhs <- rnIfaceAppArgs (ifaxbLHS d) rhs <- rnIfaceType (ifaxbRHS d) return d { ifaxbTyVars = ty_vars , ifaxbLHS = lhs @@ -613,13 +618,13 @@ rnIfaceBndrs = mapM rnIfaceBndr rnIfaceBndr :: Rename IfaceBndr rnIfaceBndr (IfaceIdBndr (fs, ty)) = IfaceIdBndr <$> ((,) fs <$> rnIfaceType ty) -rnIfaceBndr (IfaceTvBndr tv_bndr) = IfaceIdBndr <$> rnIfaceTvBndr tv_bndr +rnIfaceBndr (IfaceTvBndr tv_bndr) = IfaceTvBndr <$> rnIfaceTvBndr tv_bndr rnIfaceTvBndr :: Rename IfaceTvBndr rnIfaceTvBndr (fs, kind) = (,) fs <$> rnIfaceType kind rnIfaceTyConBinder :: Rename IfaceTyConBinder -rnIfaceTyConBinder (TvBndr tv vis) = TvBndr <$> rnIfaceTvBndr tv <*> pure vis +rnIfaceTyConBinder (Bndr tv vis) = Bndr <$> rnIfaceBndr tv <*> pure vis rnIfaceAlt :: Rename IfaceAlt rnIfaceAlt (conalt, names, rhs) @@ -636,8 +641,14 @@ rnIfaceLetBndr (IfLetBndr fs ty info jpi) rnIfaceLamBndr :: Rename IfaceLamBndr rnIfaceLamBndr (bndr, oneshot) = (,) <$> rnIfaceBndr bndr <*> pure oneshot +rnIfaceMCo :: Rename IfaceMCoercion +rnIfaceMCo IfaceMRefl = pure IfaceMRefl +rnIfaceMCo (IfaceMCo co) = IfaceMCo <$> rnIfaceCo co + rnIfaceCo :: Rename IfaceCoercion -rnIfaceCo (IfaceReflCo role ty) = IfaceReflCo role <$> rnIfaceType ty +rnIfaceCo (IfaceReflCo ty) = IfaceReflCo <$> rnIfaceType ty +rnIfaceCo (IfaceGReflCo role ty mco) + = IfaceGReflCo role <$> rnIfaceType ty <*> rnIfaceMCo mco rnIfaceCo (IfaceFunCo role co1 co2) = IfaceFunCo role <$> rnIfaceCo co1 <*> rnIfaceCo co2 rnIfaceCo (IfaceTyConAppCo role tc cos) @@ -645,8 +656,10 @@ rnIfaceCo (IfaceTyConAppCo role tc cos) rnIfaceCo (IfaceAppCo co1 co2) = IfaceAppCo <$> rnIfaceCo co1 <*> rnIfaceCo co2 rnIfaceCo (IfaceForAllCo bndr co1 co2) - = IfaceForAllCo <$> rnIfaceTvBndr bndr <*> rnIfaceCo co1 <*> rnIfaceCo co2 + = IfaceForAllCo <$> rnIfaceBndr bndr <*> rnIfaceCo co1 <*> rnIfaceCo co2 +rnIfaceCo (IfaceFreeCoVar c) = pure (IfaceFreeCoVar c) rnIfaceCo (IfaceCoVarCo lcl) = IfaceCoVarCo <$> pure lcl +rnIfaceCo (IfaceHoleCo lcl) = IfaceHoleCo <$> pure lcl rnIfaceCo (IfaceAxiomInstCo n i cs) = IfaceAxiomInstCo <$> rnIfaceGlobal n <*> pure i <*> mapM rnIfaceCo cs rnIfaceCo (IfaceUnivCo s r t1 t2) @@ -663,7 +676,6 @@ rnIfaceCo (IfaceSubCo c) = IfaceSubCo <$> rnIfaceCo c rnIfaceCo (IfaceAxiomRuleCo ax cos) = IfaceAxiomRuleCo ax <$> mapM rnIfaceCo cos rnIfaceCo (IfaceKindCo c) = IfaceKindCo <$> rnIfaceCo c -rnIfaceCo (IfaceCoherenceCo c1 c2) = IfaceCoherenceCo <$> rnIfaceCo c1 <*> rnIfaceCo c2 rnIfaceTyCon :: Rename IfaceTyCon rnIfaceTyCon (IfaceTyCon n info) @@ -681,16 +693,16 @@ rnIfaceType :: Rename IfaceType rnIfaceType (IfaceFreeTyVar n) = pure (IfaceFreeTyVar n) rnIfaceType (IfaceTyVar n) = pure (IfaceTyVar n) rnIfaceType (IfaceAppTy t1 t2) - = IfaceAppTy <$> rnIfaceType t1 <*> rnIfaceType t2 + = IfaceAppTy <$> rnIfaceType t1 <*> rnIfaceAppArgs t2 rnIfaceType (IfaceLitTy l) = return (IfaceLitTy l) rnIfaceType (IfaceFunTy t1 t2) = IfaceFunTy <$> rnIfaceType t1 <*> rnIfaceType t2 rnIfaceType (IfaceDFunTy t1 t2) = IfaceDFunTy <$> rnIfaceType t1 <*> rnIfaceType t2 rnIfaceType (IfaceTupleTy s i tks) - = IfaceTupleTy s i <$> rnIfaceTcArgs tks + = IfaceTupleTy s i <$> rnIfaceAppArgs tks rnIfaceType (IfaceTyConApp tc tks) - = IfaceTyConApp <$> rnIfaceTyCon tc <*> rnIfaceTcArgs tks + = IfaceTyConApp <$> rnIfaceTyCon tc <*> rnIfaceAppArgs tks rnIfaceType (IfaceForAllTy tv t) = IfaceForAllTy <$> rnIfaceForAllBndr tv <*> rnIfaceType t rnIfaceType (IfaceCoercionTy co) @@ -699,9 +711,9 @@ rnIfaceType (IfaceCastTy ty co) = IfaceCastTy <$> rnIfaceType ty <*> rnIfaceCo co rnIfaceForAllBndr :: Rename IfaceForAllBndr -rnIfaceForAllBndr (TvBndr tv vis) = TvBndr <$> rnIfaceTvBndr tv <*> pure vis +rnIfaceForAllBndr (Bndr tv vis) = Bndr <$> rnIfaceBndr tv <*> pure vis -rnIfaceTcArgs :: Rename IfaceTcArgs -rnIfaceTcArgs (ITC_Invis t ts) = ITC_Invis <$> rnIfaceType t <*> rnIfaceTcArgs ts -rnIfaceTcArgs (ITC_Vis t ts) = ITC_Vis <$> rnIfaceType t <*> rnIfaceTcArgs ts -rnIfaceTcArgs ITC_Nil = pure ITC_Nil +rnIfaceAppArgs :: Rename IfaceAppArgs +rnIfaceAppArgs (IA_Invis t ts) = IA_Invis <$> rnIfaceType t <*> rnIfaceAppArgs ts +rnIfaceAppArgs (IA_Vis t ts) = IA_Vis <$> rnIfaceType t <*> rnIfaceAppArgs ts +rnIfaceAppArgs IA_Nil = pure IA_Nil |