From f8456d1ac4860a6718cca8210682e4516345baf7 Mon Sep 17 00:00:00 2001 From: simonmar Date: Sun, 28 Jan 2001 23:55:34 +0000 Subject: [PATCH] [project @ 2001-01-28 23:55:34 by simonmar] fix typos in new print-wrapping code --- ghc/compiler/typecheck/TcModule.lhs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/typecheck/TcModule.lhs b/ghc/compiler/typecheck/TcModule.lhs index 7c5f5f1..631167b 100644 --- a/ghc/compiler/typecheck/TcModule.lhs +++ b/ghc/compiler/typecheck/TcModule.lhs @@ -62,6 +62,7 @@ import HscTypes ( PersistentCompilerState(..), HomeSymbolTable, TyThing(..), implicitTyThingIds, mkTypeEnv ) +import IOExts \end{code} Outside-world interface: @@ -152,19 +153,17 @@ typecheckExpr dflags wrap_io pcs hst unqual this_mod (expr, decls) | wrap_io = tryTc_ (tc_io_expr (HsApp (HsVar printName) e)) -- Recovery case (tc_io_expr e) -- Main case | otherwise = newTyVarTy openTypeKind `thenTc` \ ty -> - tcMonoExpr expr ty `thenTc` \ (expr', lie) -> - returnTc (expr', lie, ty) + tcMonoExpr e ty `thenTc` \ (e', lie) -> + returnTc (e', lie, ty) where - -- (tc_io_expr e) typechecks 'e' if that gives a result of IO t, - -- or 'print e' otherwise. Either way the result is of type IO t tc_io_expr e = newTyVarTy openTypeKind `thenTc` \ ty -> tcLookupTyCon ioTyConName `thenNF_Tc` \ ioTyCon -> let res_ty = mkTyConApp ioTyCon [ty] in - tcMonoExpr expr res_ty `thenTc` \ (expr', lie) -> - returnTc (expr', lie, res_ty) + tcMonoExpr e res_ty `thenTc` \ (e', lie) -> + returnTc (e', lie, res_ty) --------------- typecheck :: DynFlags -- 1.7.10.4