summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsMeta.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-04-20 12:56:40 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-04-20 14:28:34 +0100
commit353d8ae6fafe117a1cac4adf6f029a5baccc2780 (patch)
tree9a55b083e597b0d2d614639a54c85b0119384bd2 /compiler/deSugar/DsMeta.hs
parent7319b80a2cdffdfac8586946d0c7b0fdc8d77dae (diff)
downloadhaskell-353d8ae6fafe117a1cac4adf6f029a5baccc2780.tar.gz
SCC analysis for instances as well as types/classes
This big patch is in pursuit of Trac #11348. It is largely the work of Alex Veith (thank you!), with some follow-up simplification and refactoring from Simon PJ. The main payload is described in RnSource Note [Dependency analysis of type, class, and instance decls] which is pretty detailed. * There is a new data type HsDecls.TyClGroup, for a strongly connected component of type/class/instance/role decls. The hs_instds field of HsGroup disappears, in consequence This forces some knock-on changes, including a minor haddock submodule update Smaller, weakly-related things * I found that both the renamer and typechecker were building an identical env for RoleAnnots, so I put common code for RoleAnnotEnv in RnEnv. * I found that tcInstDecls1 had very clumsy error handling, so I put it together into TcInstDcls.doClsInstErrorChecks
Diffstat (limited to 'compiler/deSugar/DsMeta.hs')
-rw-r--r--compiler/deSugar/DsMeta.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 8f925d3eb2..3e224a3067 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -110,7 +110,6 @@ repTopDs :: HsGroup Name -> DsM (Core (TH.Q [TH.Dec]))
repTopDs group@(HsGroup { hs_valds = valds
, hs_splcds = splcds
, hs_tyclds = tyclds
- , hs_instds = instds
, hs_derivds = derivds
, hs_fixds = fixds
, hs_defds = defds
@@ -121,7 +120,8 @@ repTopDs group@(HsGroup { hs_valds = valds
, hs_vects = vects
, hs_docs = docs })
= do { let { tv_bndrs = hsSigTvBinders valds
- ; bndrs = tv_bndrs ++ hsGroupBinders group } ;
+ ; bndrs = tv_bndrs ++ hsGroupBinders group
+ ; instds = tyclds >>= group_instds } ;
ss <- mkGenSyms bndrs ;
-- Bind all the names mainly to avoid repeated use of explicit strings.
@@ -134,7 +134,7 @@ repTopDs group@(HsGroup { hs_valds = valds
decls <- addBinds ss (
do { val_ds <- rep_val_binds valds
; _ <- mapM no_splice splcds
- ; tycl_ds <- mapM repTyClD (tyClGroupConcat tyclds)
+ ; tycl_ds <- mapM repTyClD (tyClGroupTyClDecls tyclds)
; role_ds <- mapM repRoleD (concatMap group_roles tyclds)
; inst_ds <- mapM repInstD instds
; deriv_ds <- mapM repStandaloneDerivD derivds