No longer any need to explicitly load module interface in 'toCore'
[matthijs/master-project/cλash.git] / CoreTools.hs
index bd6f329c537ea93842bf5b221998cf47fb69085c..3a028195634a61100e47ae9322df72138688e8e9 100644 (file)
@@ -38,9 +38,10 @@ import Pretty
 
 -- | Evaluate a core Type representing type level int from the tfp
 -- library to a real int.
-eval_tfp_int :: Type.Type -> Int
-eval_tfp_int ty =
+eval_tfp_int :: HscTypes.HscEnv -> Type.Type -> Int
+eval_tfp_int env ty =
   unsafeRunGhc $ do
+    GHC.setSession env
     -- Automatically import modules for any fully qualified identifiers
     setDynFlag DynFlags.Opt_ImplicitImportQualified
 
@@ -56,9 +57,7 @@ eval_tfp_int ty =
     let letexpr = HsExpr.HsLet 
           (HsBinds.HsValBinds $ (HsBinds.ValBindsIn binds) [])
           (SrcLoc.noLoc expr)
-
-    let modules = map GHC.mkModuleName ["Types.Data.Num"]
-    core <- toCore modules expr
+    core <- toCore expr
     execCore core 
 
 normalise_tfp_int :: HscTypes.HscEnv -> Type.Type -> Type.Type