@@ -21,16 +21,15 @@ import Type.Unify
2121This sorts variables into the young and old pools accordingly.
2222-}
2323generalize :: TS.Pool -> TS.Solver ()
24−generalize youngPool =
24+generalize (TS.Pool youngRank youngInhabitants) =
2525 do youngMark <- TS.uniqueMark
26− let youngRank = TS._maxRank youngPool
2726 let insert dict var =
28− do descriptor <- liftIO $ UF.descriptor var
29− liftIO $ UF.modifyDescriptor var (\desc -> desc { _mark = youngMark })
27+ do descriptor <- UF.descriptor var
28+ UF.modifyDescriptor var (\desc -> desc { _mark = youngMark })
3029 return $ Map.insertWith (++) (_rank descriptor) [var] dict
3130
3231 -- Sort the youngPool variables by rank.
33− rankDict <- foldM insert Map.empty (TS._inhabitants youngPool)
32+ rankDict <- liftIO $ foldM insert Map.empty youngInhabitants
3433
3534 -- get the ranks right for each entry.
3635 -- start at low ranks so that we only have to pass