summaryrefslogtreecommitdiff
path: root/compiler/deSugar/Desugar.hs
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-03-07 14:30:38 -0500
committerBen Gamari <ben@smart-cactus.org>2017-03-07 14:31:44 -0500
commit4bd2232754f2c0b365177d177e6d749c64e73176 (patch)
tree69f1d8fec014619513843a3dc65f57c7192aaa5a /compiler/deSugar/Desugar.hs
parent629799627f7b47c07ead984bad7f45f2a9c6d351 (diff)
downloadhaskell-4bd2232754f2c0b365177d177e6d749c64e73176.tar.gz
Desugar: Refactor initDs
As far as I can tell we were unnecessarily building a new TcgEnv when we already had one on hand. TcRnMonad now sports an initTcWithGbl function, which allows us to run a TcM monad in the context of this TcgEnv. This appears to simplify things nicely. Test Plan: Validate Reviewers: austin Subscribers: dfeuer, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D3228
Diffstat (limited to 'compiler/deSugar/Desugar.hs')
-rw-r--r--compiler/deSugar/Desugar.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/deSugar/Desugar.hs b/compiler/deSugar/Desugar.hs
index 1458b91041..f3ad8dc61b 100644
--- a/compiler/deSugar/Desugar.hs
+++ b/compiler/deSugar/Desugar.hs
@@ -20,7 +20,7 @@ import DynFlags
import HscTypes
import HsSyn
import TcRnTypes
-import TcRnMonad ( finalSafeMode, fixSafeInstances )
+import TcRnMonad ( finalSafeMode, fixSafeInstances )
import TcRnDriver ( runTcInteractive )
import Id
import Name
@@ -124,9 +124,7 @@ deSugar hsc_env
then addTicksToBinds hsc_env mod mod_loc
export_set (typeEnvTyCons type_env) binds
else return (binds, hpcInfo, Nothing)
- ; (msgs, mb_res)
- <- initDs hsc_env mod rdr_env type_env
- fam_inst_env complete_matches $
+ ; (msgs, mb_res) <- initDs hsc_env tcg_env $
do { ds_ev_binds <- dsEvBinds ev_binds
; core_prs <- dsTopLHsBinds binds_cvr
; (spec_prs, spec_rules) <- dsImpSpecs imp_specs