- let Just reconstructedType = termType term
- new_type = mostSpecificType (idType id) reconstructedType
- return . Just $ setIdType id new_type
-
- updateIds :: Session -> [Id] -> IO ()
- updateIds (Session ref) new_ids = do
- hsc_env <- readIORef ref
- let ictxt = hsc_IC hsc_env
- type_env = ic_type_env ictxt
- filtered_type_env = delListFromNameEnv type_env (map idName new_ids)
- new_type_env = extendTypeEnvWithIds filtered_type_env new_ids
- new_ic = ictxt {ic_type_env = new_type_env }
- writeIORef ref (hsc_env {hsc_IC = new_ic })
+ -- Then, we extract a substitution,
+ -- mapping the old tyvars to the reconstructed types.
+ let Just reconstructed_type = termType term
+ mb_subst = computeRTTIsubst (idType id) (reconstructed_type)