Adapt TcFix imports
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 20 Sep 2006 18:50:41 +0000 (18:50 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 20 Sep 2006 18:50:41 +0000 (18:50 +0000)
Tue Sep 19 14:11:55 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
  * Adapt TcFix imports

compiler/typecheck/TcPat.lhs

index 0f923ff..3ebb7b7 100644 (file)
@@ -21,6 +21,7 @@ import Inst           ( InstOrigin(..), shortCutFracLit, shortCutIntLit,
                          newDictBndrs, instToId, instStupidTheta, isHsVar
                        )
 import Id              ( Id, idType, mkLocalId )
                          newDictBndrs, instToId, instStupidTheta, isHsVar
                        )
 import Id              ( Id, idType, mkLocalId )
+import Var             ( CoVar )
 import CoreFVs         ( idFreeTyVars )
 import Name            ( Name, mkSystemVarName )
 import TcSimplify      ( tcSimplifyCheck, bindInstsOfLocalFuns )
 import CoreFVs         ( idFreeTyVars )
 import Name            ( Name, mkSystemVarName )
 import TcSimplify      ( tcSimplifyCheck, bindInstsOfLocalFuns )
@@ -28,14 +29,15 @@ import TcEnv                ( newLocalName, tcExtendIdEnv1, tcExtendTyVarEnv2,
                          tcLookupClass, tcLookupDataCon, refineEnvironment,
                          tcLookupField, tcMetaTy )
 import TcMType                 ( newFlexiTyVarTy, arityErr, tcInstSkolTyVars, 
                          tcLookupClass, tcLookupDataCon, refineEnvironment,
                          tcLookupField, tcMetaTy )
 import TcMType                 ( newFlexiTyVarTy, arityErr, tcInstSkolTyVars, 
-                         newCoVars, zonkTcType, tcInstTyVars )
+                         newCoVars, zonkTcType, tcInstTyVars, newBoxyTyVar )
 import TcType          ( TcType, TcTyVar, TcSigmaType, TcRhoType, BoxyType,
                          SkolemInfo(PatSkol), 
                          BoxySigmaType, BoxyRhoType, argTypeKind, typeKind,
                          pprSkolTvBinding, isRigidTy, tcTyVarsOfTypes, 
 import TcType          ( TcType, TcTyVar, TcSigmaType, TcRhoType, BoxyType,
                          SkolemInfo(PatSkol), 
                          BoxySigmaType, BoxyRhoType, argTypeKind, typeKind,
                          pprSkolTvBinding, isRigidTy, tcTyVarsOfTypes, 
-                         zipTopTvSubst, isArgTypeKind, isUnboxedTupleType,
+                         zipTopTvSubst, isSubArgTypeKind, isUnboxedTupleType,
                          mkTyVarTys, mkClassPred, isOverloadedTy, substEqSpec,
                          mkTyVarTys, mkClassPred, isOverloadedTy, substEqSpec,
-                         mkFunTy, mkFunTys, tidyOpenType, tidyOpenTypes )
+                         mkFunTy, mkFunTys, tidyOpenType, tidyOpenTypes,
+                         mkTyVarTy )
 import VarSet          ( elemVarSet )
 import {- Kind parts of -} 
        Type            ( liftedTypeKind )
 import VarSet          ( elemVarSet )
 import {- Kind parts of -} 
        Type            ( liftedTypeKind )
@@ -44,6 +46,7 @@ import TcUnify                ( boxySplitTyConApp, boxySplitListTy, unBox,
                          checkSigTyVarsWrt, unifyType )
 import TcHsType                ( UserTypeCtxt(..), tcPatSig )
 import TysWiredIn      ( boolTy, parrTyCon, tupleTyCon )
                          checkSigTyVarsWrt, unifyType )
 import TcHsType                ( UserTypeCtxt(..), tcPatSig )
 import TysWiredIn      ( boolTy, parrTyCon, tupleTyCon )
+import TcGadt          ( Refinement, emptyRefinement, gadtRefine, refineType )
 import Type            ( Type, mkTyConApp, substTys, substTheta )
 import StaticFlags     ( opt_IrrefutableTuples )
 import TyCon           ( TyCon, FieldLabel, tyConFamInst_maybe,
 import Type            ( Type, mkTyConApp, substTys, substTheta )
 import StaticFlags     ( opt_IrrefutableTuples )
 import TyCon           ( TyCon, FieldLabel, tyConFamInst_maybe,
@@ -227,7 +230,7 @@ unBoxArgType ty pp_this
        -- but they improve error messages, and allocate fewer tyvars
        ; if isUnboxedTupleType ty' then
                failWithTc msg
        -- but they improve error messages, and allocate fewer tyvars
        ; if isUnboxedTupleType ty' then
                failWithTc msg
-         else if isArgTypeKind (typeKind ty') then
+         else if isSubArgTypeKind (typeKind ty') then
                return ty'
          else do       -- OpenTypeKind, so constrain it
        { ty2 <- newFlexiTyVarTy argTypeKind
                return ty'
          else do       -- OpenTypeKind, so constrain it
        { ty2 <- newFlexiTyVarTy argTypeKind