[commit: ghc] master: Use runTcSDeriveds for simplifyDefault (f79b9ec)

git at git.haskell.org git at git.haskell.org
Mon Feb 8 15:07:51 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f79b9ec98ac1ea1d6ce1995a29e2a24737518e77/ghc

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

commit f79b9ec98ac1ea1d6ce1995a29e2a24737518e77
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Feb 8 13:36:31 2016 +0000

    Use runTcSDeriveds for simplifyDefault
    
    This is a small refactoring, no change in behaviour.


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

f79b9ec98ac1ea1d6ce1995a29e2a24737518e77
 compiler/typecheck/TcSimplify.hs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs
index 379e17f..8a57877 100644
--- a/compiler/typecheck/TcSimplify.hs
+++ b/compiler/typecheck/TcSimplify.hs
@@ -396,13 +396,14 @@ simplifyDefault :: ThetaType    -- Wanted; has no type variables in it
                 -> TcM ()       -- Succeeds if the constraint is soluble
 simplifyDefault theta
   = do { traceTc "simplifyInteractive" empty
-       ; wanted <- newWanteds DefaultOrigin theta
-       ; unsolved <- simplifyWantedsTcM wanted
-
+       ; loc <- getCtLocM DefaultOrigin Nothing
+       ; let wanted = [ CtDerived { ctev_pred = pred
+                                  , ctev_loc  = loc }
+                      | pred <- theta ]
+       ; unsolved <- runTcSDeriveds (solveWanteds (mkSimpleWC wanted))
        ; traceTc "reportUnsolved {" empty
        ; reportAllUnsolved unsolved
        ; traceTc "reportUnsolved }" empty
-
        ; return () }
 
 ------------------



More information about the ghc-commits mailing list