-- | 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
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