summaryrefslogtreecommitdiff
path: root/compiler/deSugar/Check.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-05-21 09:00:32 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-05-21 13:04:09 +0100
commitb7e80ae005d0072eda79135c371a794dc48f70e1 (patch)
treed58ed53143606ea688e5e1a5e175a5725625393e /compiler/deSugar/Check.hs
parent5f3fb71213e78838cd3060be37ad2d9dd1ed247f (diff)
downloadhaskell-b7e80ae005d0072eda79135c371a794dc48f70e1.tar.gz
Remove TcType.toTcType
In the olden days we insisted that only TcTyVars could appear in a TcType. But now we are more accommodating; see TcType Note [TcTyVars and TyVars in the typechecker] This patch removes a function that converted a Type to a TcType. It didn't do anything useful except statisfy an invariant that we no longer have. Now it's gone.
Diffstat (limited to 'compiler/deSugar/Check.hs')
-rw-r--r--compiler/deSugar/Check.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index b383fb2f5d..39f585394a 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -44,7 +44,7 @@ import HscTypes (CompleteMatch(..))
import DsMonad
import TcSimplify (tcCheckSatisfiability)
-import TcType (toTcType, isStringTy, isIntTy, isWordTy)
+import TcType (isStringTy, isIntTy, isWordTy)
import Bag
import ErrUtils
import Var (EvVar)
@@ -624,12 +624,12 @@ inhabitationCandidates fam_insts ty
Just (tc, _)
| tc `elem` trivially_inhabited -> case dcs of
[] -> return (Left src_ty)
- (_:_) -> do var <- liftD $ mkPmId (toTcType core_ty)
+ (_:_) -> do var <- liftD $ mkPmId core_ty
let va = build_tm (PmVar var) dcs
return $ Right [(va, mkIdEq var, emptyBag)]
| pmIsClosedType core_ty -> liftD $ do
- var <- mkPmId (toTcType core_ty) -- it would be wrong to unify x
+ var <- mkPmId core_ty -- it would be wrong to unify x
alts <- mapM (mkOneConFull var . RealDataCon) (tyConDataCons tc)
return $ Right [(build_tm va dcs, eq, cs) | (va, eq, cs) <- alts]
-- For other types conservatively assume that they are inhabited.
@@ -1330,7 +1330,7 @@ allCompleteMatches cl tys = do
-- * Types and constraints
newEvVar :: Name -> Type -> EvVar
-newEvVar name ty = mkLocalId name (toTcType ty)
+newEvVar name ty = mkLocalId name ty
nameType :: String -> Type -> DsM EvVar
nameType name ty = do