diff options
author | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-11-06 19:01:38 +0800 |
---|---|---|
committer | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-11-08 14:02:19 +0800 |
commit | 65dc594b156c9cc5c2e9bc640f0762beaf3ca6ca (patch) | |
tree | 3725e96d5672829a199a50bc0e7a7e05487df601 /compiler/iface | |
parent | 474e535b6b121809a8d75df5a4c37dc574d3d302 (diff) | |
download | haskell-65dc594b156c9cc5c2e9bc640f0762beaf3ca6ca.tar.gz |
Group PatSyn req/prov arguments together so that they're not all over the place
Diffstat (limited to 'compiler/iface')
-rw-r--r-- | compiler/iface/BuildTyCl.lhs | 23 | ||||
-rw-r--r-- | compiler/iface/TcIface.lhs | 3 |
2 files changed, 12 insertions, 14 deletions
diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index 2a66de28ac..d90e63c972 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -180,32 +180,29 @@ mkDataConStupidTheta tycon arg_tys univ_tvs ------------------------------------------------------ buildPatSyn :: Name -> Bool -> Id -> Maybe Id - -> [Type] - -> [TyVar] -> [TyVar] -- Univ and ext - -> ThetaType -> ThetaType -- Prov and req - -> Type -- Result type + -> ([TyVar], ThetaType) -- ^ Univ and req + -> ([TyVar], ThetaType) -- ^ Ex and prov + -> [Type] -- ^ Argument types + -> Type -- ^ Result type -> PatSyn buildPatSyn src_name declared_infix matcher wrapper - args univ_tvs ex_tvs prov_theta req_theta pat_ty + (univ_tvs, req_theta) (ex_tvs, prov_theta) arg_tys pat_ty = ASSERT((and [ univ_tvs == univ_tvs' , ex_tvs == ex_tvs' , pat_ty `eqType` pat_ty' , prov_theta `eqTypes` prov_theta' , req_theta `eqTypes` req_theta' - , args `eqTypes` args' + , arg_tys `eqTypes` arg_tys' ])) mkPatSyn src_name declared_infix - args - univ_tvs ex_tvs - prov_theta req_theta - pat_ty - matcher - wrapper + (univ_tvs, req_theta) (ex_tvs, prov_theta) + arg_tys pat_ty + matcher wrapper where ((_:univ_tvs'), req_theta', tau) = tcSplitSigmaTy $ idType matcher ([pat_ty', cont_sigma, _], _) = tcSplitFunTys tau (ex_tvs', prov_theta', cont_tau) = tcSplitSigmaTy cont_sigma - (args', _) = tcSplitFunTys cont_tau + (arg_tys', _) = tcSplitFunTys cont_tau \end{code} diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 4e2cfd5a76..65345ec3c8 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -605,7 +605,8 @@ tc_iface_decl _ _ (IfacePatSyn{ ifName = occ_name ; pat_ty <- tcIfaceType pat_ty ; arg_tys <- mapM tcIfaceType args ; return $ buildPatSyn name is_infix matcher wrapper - arg_tys univ_tvs ex_tvs prov_theta req_theta pat_ty } + (univ_tvs, req_theta) (ex_tvs, prov_theta) + arg_tys pat_ty } ; return $ AConLike . PatSynCon $ patsyn }}} where mk_doc n = ptext (sLit "Pattern synonym") <+> ppr n |