summaryrefslogtreecommitdiff
path: root/compiler/main/TidyPgm.lhs
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2014-04-22 02:12:03 -0500
committerAustin Seipp <austin@well-typed.com>2014-04-22 06:16:50 -0500
commitfe77cbf15dd44bb72943357d65bd8adf9f4deee5 (patch)
tree04724d7fcf4b2696d2342c5b31c1f59ebaa92cb1 /compiler/main/TidyPgm.lhs
parent33e585d6eacae19e83862a05b650373b536095fa (diff)
downloadhaskell-wip/orf.tar.gz
ghc: implement OverloadedRecordFieldswip/orf
This fully implements the new ORF extension, developed during the Google Summer of Code 2013, and as described on the wiki: https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields This also updates the Haddock submodule. Reviewed-by: Simon Peyton Jones <simonpj@microsoft.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/main/TidyPgm.lhs')
-rw-r--r--compiler/main/TidyPgm.lhs12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs
index b20658b073..d4c13a9b08 100644
--- a/compiler/main/TidyPgm.lhs
+++ b/compiler/main/TidyPgm.lhs
@@ -130,7 +130,8 @@ mkBootModDetailsTc hsc_env
tcg_type_env = type_env, -- just for the Ids
tcg_tcs = tcs,
tcg_insts = insts,
- tcg_fam_insts = fam_insts
+ tcg_fam_insts = fam_insts,
+ tcg_axioms = axioms
}
= do { let dflags = hsc_dflags hsc_env
; showPass dflags CoreTidy
@@ -139,10 +140,11 @@ mkBootModDetailsTc hsc_env
; dfun_ids = map instanceDFunId insts'
; type_env1 = mkBootTypeEnv (availsToNameSet exports)
(typeEnvIds type_env) tcs fam_insts
- ; type_env2 = extendTypeEnvWithPatSyns type_env1 (typeEnvPatSyns type_env)
- ; type_env' = extendTypeEnvWithIds type_env2 dfun_ids
+ ; type_env2 = extendTypeEnvList type_env1 (map ACoAxiom axioms)
+ ; type_env3 = extendTypeEnvWithPatSyns type_env2 (typeEnvPatSyns type_env)
+ ; type_env4 = extendTypeEnvWithIds type_env3 dfun_ids
}
- ; return (ModDetails { md_types = type_env'
+ ; return (ModDetails { md_types = type_env4
, md_insts = insts'
, md_fam_insts = fam_insts
, md_rules = []
@@ -296,6 +298,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
, mg_tcs = tcs
, mg_insts = insts
, mg_fam_insts = fam_insts
+ , mg_axioms = axioms
, mg_binds = binds
, mg_patsyns = patsyns
, mg_rules = imp_rules
@@ -314,6 +317,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
; showPass dflags CoreTidy
; let { type_env = typeEnvFromEntities [] tcs fam_insts
+ `extendTypeEnvList` map ACoAxiom axioms
; implicit_binds
= concatMap getClassImplicitBinds (typeEnvClasses type_env) ++