X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcArrows.lhs;h=8276bc893cb6ca6b667cbeeb977b945cbeda1e5f;hp=c575808a97ff019905fc3c63e805cbbd026f0455;hb=bfe55fb767d566b5105c5584f698af1dd4a57346;hpb=a07a463449d54855f19c160ed0f0a3853663db5f diff --git a/compiler/typecheck/TcArrows.lhs b/compiler/typecheck/TcArrows.lhs index c575808..8276bc8 100644 --- a/compiler/typecheck/TcArrows.lhs +++ b/compiler/typecheck/TcArrows.lhs @@ -31,6 +31,7 @@ import TcGadt import TcPat import TcUnify import TcRnMonad +import Coercion import Inst import Name import TysWiredIn @@ -52,16 +53,18 @@ import Util \begin{code} tcProc :: InPat Name -> LHsCmdTop Name -- proc pat -> expr -> BoxyRhoType -- Expected type of whole proc expression - -> TcM (OutPat TcId, LHsCmdTop TcId) + -> TcM (OutPat TcId, LHsCmdTop TcId, CoercionI) tcProc pat cmd exp_ty = newArrowScope $ - do { (exp_ty1, res_ty) <- boxySplitAppTy exp_ty - ; (arr_ty, arg_ty) <- boxySplitAppTy exp_ty1 + do { ((exp_ty1, res_ty), coi) <- boxySplitAppTy exp_ty + ; ((arr_ty, arg_ty), coi1) <- boxySplitAppTy exp_ty1 ; let cmd_env = CmdEnv { cmd_arr = arr_ty } ; (pat', cmd') <- tcLamPat pat arg_ty (emptyRefinement, res_ty) $ tcCmdTop cmd_env cmd [] - ; return (pat', cmd') } + ; let res_coi = mkTransCoI coi (mkAppTyCoI exp_ty1 coi1 res_ty IdCo) + ; return (pat', cmd', res_coi) + } \end{code}