Commit 29b46327 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Inline solveTopConstraints

It was only called in one place; easier to inline it
parent 4dda4edb
{-# LANGUAGE CPP #-}
module TcSimplify(
simplifyInfer, solveTopConstraints,
simplifyInfer,
growThetaTyVars,
simplifyAmbiguityCheck,
simplifyDefault,
......@@ -187,14 +187,6 @@ defaultCallStacks wanteds
= return (Just ct)
-- | Type-check a thing, returning the result and any EvBinds produced
-- during solving. Emits errors -- but does not fail -- if there is trouble.
solveTopConstraints :: TcM a -> TcM (a, Bag EvBind)
solveTopConstraints thing_inside
= do { (result, wanted) <- captureConstraints thing_inside
; ev_binds <- simplifyTop wanted
; return (result, ev_binds) }
{-
Note [When to do type-class defaulting]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -528,7 +528,8 @@ tcTopSpliceExpr isTypedSplice tc_action
-- is expected (Trac #7276)
setStage (Splice isTypedSplice) $
do { -- Typecheck the expression
(expr', const_binds) <- solveTopConstraints tc_action
(expr', wanted) <- captureConstraints tc_action
; const_binds <- simplifyTop wanted
-- Zonk it and tie the knot of dictionary bindings
; zonkTopLExpr (mkHsDictLet (EvBinds const_binds) expr') }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment