diff options
author | ningning <xnningxie@gmail.com> | 2018-09-15 10:16:47 -0400 |
---|---|---|
committer | Richard Eisenberg <rae@cs.brynmawr.edu> | 2018-09-15 10:28:41 -0400 |
commit | ea5ade34788f29f5902c5475e94fbac13110eea5 (patch) | |
tree | 3a17314dc67df885c3cdf681a6aec449ae808d8f /compiler/backpack | |
parent | c23f057f1753634e2bc0612969470efea6443031 (diff) | |
download | haskell-ea5ade34788f29f5902c5475e94fbac13110eea5.tar.gz |
Coercion Quantification
This patch corresponds to #15497.
According to https://ghc.haskell.org/trac/ghc/wiki/DependentHaskell/Phase2,
we would like to have coercion quantifications back. This will
allow us to migrate (~#) to be homogeneous, instead of its current
heterogeneous definition. This patch is (lots of) plumbing only. There
should be no user-visible effects.
An overview of changes:
- Both `ForAllTy` and `ForAllCo` can quantify over coercion variables,
but only in *Core*. All relevant functions are updated accordingly.
- Small changes that should be irrelevant to the main task:
1. removed dead code `mkTransAppCo` in Coercion
2. removed out-dated Note Computing a coercion kind and
roles in Coercion
3. Added `Eq4` in Note Respecting definitional equality in
TyCoRep, and updated `mkCastTy` accordingly.
4. Various updates and corrections of notes and typos.
- Haddock submodule needs to be changed too.
Acknowledgments:
This work was completed mostly during Ningning Xie's Google Summer
of Code, sponsored by Google. It was advised by Richard Eisenberg,
supported by NSF grant 1704041.
Test Plan: ./validate
Reviewers: goldfire, simonpj, bgamari, hvr, erikd, simonmar
Subscribers: RyanGlScott, monoidal, rwbarton, carter
GHC Trac Issues: #15497
Differential Revision: https://phabricator.haskell.org/D5054
Diffstat (limited to 'compiler/backpack')
-rw-r--r-- | compiler/backpack/RnModIface.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/backpack/RnModIface.hs b/compiler/backpack/RnModIface.hs index 51f312f975..3ae01d72b8 100644 --- a/compiler/backpack/RnModIface.hs +++ b/compiler/backpack/RnModIface.hs @@ -524,7 +524,7 @@ rnIfaceConDecls IfAbstractTyCon = pure IfAbstractTyCon rnIfaceConDecl :: Rename IfaceConDecl rnIfaceConDecl d = do con_name <- rnIfaceGlobal (ifConName d) - con_ex_tvs <- mapM rnIfaceTvBndr (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) @@ -535,7 +535,7 @@ 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 @@ -624,7 +624,7 @@ 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) @@ -656,7 +656,7 @@ 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 @@ -711,7 +711,7 @@ 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 rnIfaceAppArgs :: Rename IfaceAppArgs rnIfaceAppArgs (IA_Invis t ts) = IA_Invis <$> rnIfaceType t <*> rnIfaceAppArgs ts |