[commit: ghc] master: Get rid of now-outdated zonkTypeCarefully (384c386)
Simon Peyton Jones
simonpj at microsoft.com
Thu Feb 16 16:11:24 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/384c38649320cb99e1c6af984786ef463799e9f3
>---------------------------------------------------------------
commit 384c38649320cb99e1c6af984786ef463799e9f3
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Feb 16 13:43:36 2012 +0000
Get rid of now-outdated zonkTypeCarefully
>---------------------------------------------------------------
compiler/typecheck/TcBinds.lhs | 4 ++--
compiler/typecheck/TcExpr.lhs | 2 +-
compiler/typecheck/TcPat.lhs | 14 +-------------
3 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/compiler/typecheck/TcBinds.lhs b/compiler/typecheck/TcBinds.lhs
index e14bd49..7654f01 100644
--- a/compiler/typecheck/TcBinds.lhs
+++ b/compiler/typecheck/TcBinds.lhs
@@ -371,7 +371,7 @@ tcPolyNoGen tc_sig_fn prag_fn rec_tc bind_list
; return (binds', mono_ids', NotTopLevel) }
where
tc_mono_info (name, _, mono_id)
- = do { mono_ty' <- zonkTcTypeCarefully (idType mono_id)
+ = do { mono_ty' <- zonkTcType (idType mono_id)
-- Zonk, mainly to expose unboxed types to checkStrictBinds
; let mono_id' = setIdType mono_id mono_ty'
; _specs <- tcSpecPrags mono_id' (prag_fn name)
@@ -471,7 +471,7 @@ mkExport :: PragFun
-- Pre-condition: the qtvs and theta are already zonked
mkExport prag_fn qtvs theta (poly_name, mb_sig, mono_id)
- = do { mono_ty <- zonkTcTypeCarefully (idType mono_id)
+ = do { mono_ty <- zonkTcType (idType mono_id)
; let inferred_poly_ty = mkSigmaTy my_tvs theta mono_ty
my_tvs = filter (`elemVarSet` used_tvs) qtvs
used_tvs = tyVarsOfTypes theta `unionVarSet` tyVarsOfType mono_ty
diff --git a/compiler/typecheck/TcExpr.lhs b/compiler/typecheck/TcExpr.lhs
index abcff85..a48b9bf 100644
--- a/compiler/typecheck/TcExpr.lhs
+++ b/compiler/typecheck/TcExpr.lhs
@@ -892,7 +892,7 @@ tcInferFun fun
-- Zonk the function type carefully, to expose any polymorphism
-- E.g. (( \(x::forall a. a->a). blah ) e)
-- We can see the rank-2 type of the lambda in time to genrealise e
- ; fun_ty' <- zonkTcTypeCarefully fun_ty
+ ; fun_ty' <- zonkTcType fun_ty
; (wrap, rho) <- deeplyInstantiate AppOrigin fun_ty'
; return (mkLHsWrap wrap fun, rho) }
diff --git a/compiler/typecheck/TcPat.lhs b/compiler/typecheck/TcPat.lhs
index f1f502d..41647e7 100644
--- a/compiler/typecheck/TcPat.lhs
+++ b/compiler/typecheck/TcPat.lhs
@@ -275,21 +275,9 @@ checkUnboxedTuple :: TcType -> SDoc -> TcM ()
-- (This shows up as a (more obscure) kind error
-- in the 'otherwise' case of tcMonoBinds.)
checkUnboxedTuple ty what
- = do { zonked_ty <- zonkTcTypeCarefully ty
+ = do { zonked_ty <- zonkTcType ty
; checkTc (not (isUnboxedTupleType zonked_ty))
(unboxedTupleErr what zonked_ty) }
-
--------------------
-{- Only needed if we re-add Method constraints
-bindInstsOfPatId :: TcId -> TcM a -> TcM (a, TcEvBinds)
-bindInstsOfPatId id thing_inside
- | not (isOverloadedTy (idType id))
- = do { res <- thing_inside; return (res, emptyTcEvBinds) }
- | otherwise
- = do { (res, lie) <- captureConstraints thing_inside
- ; binds <- bindLocalMethods lie [id]
- ; return (res, binds) }
--}
\end{code}
Note [Polymorphism and pattern bindings]
More information about the Cvs-ghc
mailing list