X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnTypes.lhs;h=cbc0fe4f4df27dd1932f964ac7d91c35c567a5d5;hp=28bfd8ecb72a8d7c3e35335f1263367334ca1868;hb=296058a1cafa80dec0b3f998348bce7c65f668b0;hpb=25b72d3e7da625732cbfbbe729a3e4321fd91ced diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs index 28bfd8e..cbc0fe4 100644 --- a/compiler/typecheck/TcRnTypes.lhs +++ b/compiler/typecheck/TcRnTypes.lhs @@ -34,7 +34,7 @@ module TcRnTypes( plusLIEs, mkLIE, isEmptyLIE, lieToList, listToLIE, -- Misc other types - TcId, TcIdSet, TcDictBinds, + TcId, TcIdSet, TcDictBinds, TcTyVarBind(..), TcTyVarBinds ) where @@ -98,6 +98,18 @@ type RnM a = TcRn a -- Historical type TcM a = TcRn a -- Historical \end{code} +Representation of type bindings to uninstantiated meta variables used during +constraint solving. + +\begin{code} +data TcTyVarBind = TcTyVarBind TcTyVar TcType + +type TcTyVarBinds = Bag TcTyVarBind + +instance Outputable TcTyVarBind where + ppr (TcTyVarBind tv ty) = ppr tv <+> text ":=" <+> ppr ty +\end{code} + %************************************************************************ %* * @@ -343,15 +355,20 @@ data TcLclEnv -- Changes as we move inside an expression -- We still need the unsullied global name env so that -- we can look up record field names - tcl_env :: NameEnv TcTyThing, -- The local type environment: Ids and TyVars - -- defined in this module + tcl_env :: NameEnv TcTyThing, -- The local type environment: Ids and + -- TyVars defined in this module tcl_tyvars :: TcRef TcTyVarSet, -- The "global tyvars" -- Namely, the in-scope TyVars bound in tcl_env, - -- plus the tyvars mentioned in the types of Ids bound in tcl_lenv - -- Why mutable? see notes with tcGetGlobalTyVars + -- plus the tyvars mentioned in the types of Ids bound + -- in tcl_lenv. + -- Why mutable? see notes with tcGetGlobalTyVars + + tcl_lie :: TcRef LIE, -- Place to accumulate type constraints - tcl_lie :: TcRef LIE -- Place to accumulate type constraints + tcl_tybinds :: TcRef TcTyVarBinds -- Meta and coercion type variable + -- bindings accumulated during + -- constraint solving }