[project @ 1996-07-19 18:36:04 by partain]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcSimplify.lhs
index a1e987a..061dc65 100644 (file)
@@ -17,7 +17,7 @@ IMP_Ubiq()
 import HsSyn           ( MonoBinds(..), HsExpr(..), InPat, OutPat, HsLit, 
                          Match, HsBinds, Qualifier, PolyType, ArithSeqInfo,
                          GRHSsAndBinds, Stmt, Fake )
-import TcHsSyn         ( TcIdOcc(..), TcIdBndr(..), TcExpr(..), TcMonoBinds(..) )
+import TcHsSyn         ( TcIdOcc(..), SYN_IE(TcIdBndr), SYN_IE(TcExpr), SYN_IE(TcMonoBinds) )
 
 import TcMonad         hiding ( rnMtoTcM )
 import Inst            ( lookupInst, lookupSimpleInst,
@@ -25,11 +25,12 @@ import Inst         ( lookupInst, lookupSimpleInst,
                          matchesInst, instToId, instBindingRequired,
                          instCanBeGeneralised, newDictsAtLoc,
                          pprInst,
-                         Inst(..), LIE(..), zonkLIE, emptyLIE,
+                         Inst(..), SYN_IE(LIE), zonkLIE, emptyLIE,
                          plusLIE, unitLIE, consLIE, InstOrigin(..),
                          OverloadedLit )
 import TcEnv           ( tcGetGlobalTyVars )
-import TcType          ( TcType(..), TcTyVar(..), TcTyVarSet(..), TcMaybe, tcInstType )
+import SpecEnv         ( SpecEnv )
+import TcType          ( SYN_IE(TcType), SYN_IE(TcTyVar), SYN_IE(TcTyVarSet), TcMaybe, tcInstType )
 import Unify           ( unifyTauTy )
 
 import Bag             ( Bag, unitBag, listToBag, foldBag, filterBag, emptyBag, bagToList, 
@@ -41,11 +42,10 @@ import Class                ( GenClass, SYN_IE(Class), SYN_IE(ClassInstEnv),
 import Id              ( GenId )
 import Maybes          ( expectJust, firstJust, catMaybes, seqMaybe, maybeToBool )
 import Outputable      ( Outputable(..){-instance * []-} )
-import PprStyle--ToDo:rm
-import PprType         ( GenType, GenTyVar, GenClass{-instance Outputable;ToDo:rm-} )
+--import PprStyle--ToDo:rm
+import PprType         ( GenType, GenTyVar )
 import Pretty
 import SrcLoc          ( mkUnknownSrcLoc )
-import Util
 import Type            ( GenType, SYN_IE(Type), SYN_IE(TauType), mkTyVarTy, getTyVar, eqSimpleTy,
                          getTyVar_maybe )
 import TysWiredIn      ( intTy )
@@ -53,6 +53,7 @@ import TyVar          ( GenTyVar, SYN_IE(GenTyVarSet),
                          elementOfTyVarSet, emptyTyVarSet, unionTyVarSets,
                          isEmptyTyVarSet, tyVarSetToList )
 import Unique          ( Unique )
+import Util
 \end{code}
 
 
@@ -686,7 +687,7 @@ disambigOne dict_infos
        -- See if any default works, and if so bind the type variable to it
     try_default default_tys            `thenTc` \ chosen_default_ty ->
     tcInstType [] chosen_default_ty    `thenNF_Tc` \ chosen_default_tc_ty ->   -- Tiresome!
-    unifyTauTy (mkTyVarTy tyvar) chosen_default_tc_ty
+    unifyTauTy chosen_default_tc_ty (mkTyVarTy tyvar)
 
   where
     (_,_,tyvar) = head dict_infos              -- Should be non-empty