@@ -24,10 +24,12 @@ data Pool = Pool {
25emptyPool = Pool { maxRank = outermostRank, inhabitants = [] }
25emptyPool = Pool { maxRank = outermostRank, inhabitants = [] }
27+type Env = Map.Map String Variable
27-- Keeps track of the environment, type variable pool, and a list of errors
29-- Keeps track of the environment, type variable pool, and a list of errors
28data SolverState = SS {
30data SolverState = SS {
29− sEnv :: Map.Map String Variable,
31+ sEnv :: Env,
30− sSavedEnv :: Map.Map String Variable,
32+ sSavedEnv :: Env,
31 sPool :: Pool,
33 sPool :: Pool,
32 sMark :: Int,
34 sMark :: Int,
33 sErrors :: [IO P.Doc]
35 sErrors :: [IO P.Doc]
@@ -77,7 +79,7 @@ switchToPool pool = modifyPool (\_ -> pool)
77getPool :: StateT SolverState IO Pool
79getPool :: StateT SolverState IO Pool
78getPool = sPool <$> get
80getPool = sPool <$> get
80−getEnv :: StateT SolverState IO (Map.Map String Variable)
82+getEnv :: StateT SolverState IO Env
81getEnv = sEnv <$> get
83getEnv = sEnv <$> get
83saveLocalEnv :: StateT SolverState IO ()
85saveLocalEnv :: StateT SolverState IO ()