Remove unused substTyWithBinders functions
authorBartosz Nitka <niteria@gmail.com>
Mon, 21 Mar 2016 12:33:44 +0000 (05:33 -0700)
committerBartosz Nitka <niteria@gmail.com>
Mon, 21 Mar 2016 12:34:00 +0000 (05:34 -0700)
Originally I wanted to only remove substTyWithBindersUnchecked, but
since both of them are unused maybe we don't need them.

Test Plan: ./validate

Reviewers: austin, goldfire, bgamari, simonpj

Reviewed By: simonpj

Subscribers: thomie, simonmar

Differential Revision: https://phabricator.haskell.org/D2025

GHC Trac Issues: #11371

compiler/typecheck/TcType.hs
compiler/types/TyCoRep.hs
compiler/types/Type.hs

index 5b37a00..cf3b317 100644 (file)
@@ -156,7 +156,7 @@ module TcType (
   Type.substTy, substTys, substTyWith, substTyWithCoVars,
   substTyAddInScope,
   substTyUnchecked, substTysUnchecked, substThetaUnchecked,
-  substTyWithBindersUnchecked, substTyWithUnchecked,
+  substTyWithUnchecked,
   substCoUnchecked, substCoWithUnchecked,
   substTheta,
 
index 6fe1ce3..9a2036a 100644 (file)
@@ -97,9 +97,9 @@ module TyCoRep (
         substCoWith,
         substTy, substTyAddInScope,
         substTyUnchecked, substTysUnchecked, substThetaUnchecked,
-        substTyWithBindersUnchecked, substTyWithUnchecked,
+        substTyWithUnchecked,
         substCoUnchecked, substCoWithUnchecked,
-        substTyWithBinders, substTyWithInScope,
+        substTyWithInScope,
         substTys, substTheta,
         lookupTyVar, substTyVarBndr,
         substCo, substCos, substCoVar, substCoVars, lookupCoVar,
@@ -1944,28 +1944,6 @@ substTysWithCoVars :: [CoVar] -> [Coercion] -> [Type] -> [Type]
 substTysWithCoVars cvs cos = ASSERT( length cvs == length cos )
                              substTys (zipCvSubst cvs cos)
 
--- | Type substitution using 'Binder's. Anonymous binders
--- simply ignore their matching type.
-substTyWithBinders ::
--- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1
-#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0)
-    (?callStack :: CallStack) =>
-#endif
-    [TyBinder] -> [Type] -> Type -> Type
-substTyWithBinders bndrs tys = ASSERT( length bndrs == length tys )
-                               substTy (zipTyBinderSubst bndrs tys)
-
--- | Type substitution using 'Binder's disabling the sanity checks.
--- Anonymous binders simply ignore their matching type.
--- The problems that the sanity checks in substTy catch are described in
--- Note [The substitution invariant].
--- The goal of #11371 is to migrate all the calls of substTyUnchecked to
--- substTy and remove this function. Please don't use in new code.
-substTyWithBindersUnchecked :: [TyBinder] -> [Type] -> Type -> Type
-substTyWithBindersUnchecked bndrs tys
-  = ASSERT( length bndrs == length tys )
-    substTyUnchecked (zipTyBinderSubst bndrs tys)
-
 -- | Substitute within a 'Type' after adding the free variables of the type
 -- to the in-scope set. This is useful for the case when the free variables
 -- aren't already in the in-scope set or easily available.
index a3efac0..f7aea67 100644 (file)
@@ -166,7 +166,7 @@ module Type (
         substTy, substTys, substTyWith, substTysWith, substTheta,
         substTyAddInScope,
         substTyUnchecked, substTysUnchecked, substThetaUnchecked,
-        substTyWithBindersUnchecked, substTyWithUnchecked,
+        substTyWithUnchecked,
         substCoUnchecked, substCoWithUnchecked,
         substTyVarBndr, substTyVar, substTyVars,
         cloneTyVarBndr, cloneTyVarBndrs, lookupTyVar,