Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
[matthijs/master-project/cλash.git] / CoreTools.hs
index eae4122deff7425570ea5b232d4545ede76d46ac..3bfe1a156dfc89826e6070d7255a854ad514add6 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
 
@@ -222,4 +223,4 @@ getLiterals :: CoreSyn.CoreExpr -> [CoreSyn.CoreExpr]
 getLiterals app@(CoreSyn.App _ _) = literals
   where
     (CoreSyn.Var f, args) = CoreSyn.collectArgs app
-    literals = filter (is_lit) args
\ No newline at end of file
+    literals = filter (is_lit) args