[project @ 1996-12-19 09:10:02 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcPat.lhs
index 0c8470c..1a5f055 100644 (file)
@@ -8,22 +8,24 @@
 
 module TcPat ( tcPat ) where
 
-import Ubiq{-uitous-}
+IMP_Ubiq(){-uitous-}
 
 import HsSyn           ( InPat(..), OutPat(..), HsExpr(..), HsLit(..),
-                         Match, HsBinds, Qual, PolyType,
+                         Match, HsBinds, Qualifier, HsType,
                          ArithSeqInfo, Stmt, Fake )
-import RnHsSyn         ( RenamedPat(..) )
-import TcHsSyn         ( TcPat(..), TcIdOcc(..) )
+import RnHsSyn         ( SYN_IE(RenamedPat) )
+import TcHsSyn         ( SYN_IE(TcPat), TcIdOcc(..) )
 
-import TcMonad         hiding ( rnMtoTcM )
+import TcMonad
 import Inst            ( Inst, OverloadedLit(..), InstOrigin(..),
-                         emptyLIE, plusLIE, plusLIEs, LIE(..),
+                         emptyLIE, plusLIE, plusLIEs, SYN_IE(LIE),
                          newMethod, newOverloadedLit
                        )
+import Name            ( Name {- instance Outputable -} )
 import TcEnv           ( tcLookupGlobalValue, tcLookupGlobalValueByKey, 
                          tcLookupLocalValueOK )
-import TcType          ( TcType(..), TcMaybe, tcInstType, newTyVarTy, newTyVarTys, tcInstId )
+import SpecEnv         ( SpecEnv )
+import TcType          ( SYN_IE(TcType), TcMaybe, newTyVarTy, newTyVarTys, tcInstId )
 import Unify           ( unifyTauTy, unifyTauTyList, unifyTauTyLists )
 
 import Bag             ( Bag )
@@ -32,12 +34,11 @@ import Id           ( GenId, idType )
 import Kind            ( Kind, mkBoxedTypeKind, mkTypeKind )
 import Maybes          ( maybeToBool )
 import PprType         ( GenType, GenTyVar )
-import PprStyle--ToDo:rm
+--import PprStyle--ToDo:rm
 import Pretty
-import RnHsSyn         ( RnName{-instance Outputable-} )
 import Type            ( splitFunTy, splitRhoTy, splitSigmaTy, mkTyVarTys,
                          getFunTy_maybe, maybeAppDataTyCon,
-                         Type(..), GenType
+                         SYN_IE(Type), GenType
                        )
 import TyVar           ( GenTyVar )
 import TysPrim         ( charPrimTy, intPrimTy, floatPrimTy,
@@ -45,7 +46,7 @@ import TysPrim                ( charPrimTy, intPrimTy, floatPrimTy,
                        )
 import TysWiredIn      ( charTy, stringTy, mkListTy, mkTupleTy, addrTy )
 import Unique          ( Unique, eqClassOpKey )
-import Util            ( assertPanic, panic{-ToDo:rm-} )
+import Util            ( assertPanic, panic )
 \end{code}
 
 \begin{code}
@@ -60,7 +61,7 @@ tcPat :: RenamedPat -> TcM s (TcPat s, LIE s, TcType s)
 
 \begin{code}
 tcPat (VarPatIn name)
-  = tcLookupLocalValueOK ("tcPat1:"++ppShow 80 (ppr PprDebug name)) name       `thenNF_Tc` \ id ->
+  = tcLookupLocalValueOK ("tcPat1:"{-++ppShow 80 (ppr PprDebug name)-}) name   `thenNF_Tc` \ id ->
     returnTc (VarPat (TcId id), emptyLIE, idType id)
 
 tcPat (LazyPatIn pat)
@@ -326,7 +327,7 @@ tcPats (pat:pats)
 unifies the actual args against the expected ones.
 
 \begin{code}
-matchConArgTys :: RnName -> [TcType s] -> TcM s (Id, TcType s)
+matchConArgTys :: Name -> [TcType s] -> TcM s (Id, TcType s)
 
 matchConArgTys con arg_tys
   = tcLookupGlobalValue con            `thenNF_Tc` \ con_id ->
@@ -342,7 +343,7 @@ matchConArgTys con arg_tys
     checkTc (con_arity == no_of_args)
            (arityErr "Constructor" con_id con_arity no_of_args)        `thenTc_`
 
-    unifyTauTyLists arg_tys con_args                                   `thenTc_`
+    unifyTauTyLists con_args arg_tys                                   `thenTc_`
     returnTc (con_id, con_result)
 \end{code}