- let Just reconstructed_type = termType term
- subst = unifyRTTI (idType id) (reconstructed_type)
- return (term',subst)
-
- tidyTermTyVars :: Session -> Term -> IO Term
- tidyTermTyVars (Session ref) t = do
- hsc_env <- readIORef ref
+ let reconstructed_type = termType term
+ mb_subst <- withSession $ \hsc_env ->
+ liftIO $ improveRTTIType hsc_env (idType id) (reconstructed_type)
+ maybe (return ())
+ (\subst -> traceOptIf Opt_D_dump_rtti
+ (fsep $ [text "RTTI Improvement for", ppr id,
+ text "is the substitution:" , ppr subst]))
+ mb_subst
+ return (term', fromMaybe emptyTvSubst mb_subst)
+
+ tidyTermTyVars :: GhcMonad m => Term -> m Term
+ tidyTermTyVars t =
+ withSession $ \hsc_env -> do