[commit: ghc] wip/ext-solver: Solve only wanted constraints. (06db95b)

git at git.haskell.org git at git.haskell.org
Tue May 13 04:52:38 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/ext-solver
Link       : http://ghc.haskell.org/trac/ghc/changeset/06db95b56270cd73c52af4bf5a258f08b7820902/ghc

>---------------------------------------------------------------

commit 06db95b56270cd73c52af4bf5a258f08b7820902
Author: Iavor S. Diatchki <iavor.diatchki at gmail.com>
Date:   Mon May 12 21:51:25 2014 -0700

    Solve only wanted constraints.


>---------------------------------------------------------------

06db95b56270cd73c52af4bf5a258f08b7820902
 compiler/typecheck/TcInteract.lhs | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs
index bad7bf5..e269196 100644
--- a/compiler/typecheck/TcInteract.lhs
+++ b/compiler/typecheck/TcInteract.lhs
@@ -178,14 +178,13 @@ interactExternSolver inGivenStage =
          -- During the wanted stage, we try to solve the constraints
          -- once there is no more additional work for re-writing.
          | otherwise ->
-             do (solved, unsolved) <- extSolSolve feqs
+             do let (wanteds, others) = partition isWantedCt feqs
+                (solved, unsolved) <- extSolSolve wanteds
                 case solved of
                   [] -> return False  -- Shortcut for common case.
-                  _  -> do rebuildInerts unsolved
-                           let setEv (ev,ct)
-                                 | isWantedCt ct =
-                                    setEvBind (ctev_evar (cc_ev ct)) ev
-                                 | otherwise = return ()
+                  _  -> do rebuildInerts (unsolved ++ others)
+                           let setEv (ev,ct) =
+                                          setEvBind (ctev_evar (cc_ev ct)) ev
                            mapM_ setEv solved
                            return False
 



More information about the ghc-commits mailing list