[project @ 2002-07-29 13:19:52 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcType.lhs
index 8e3862c..8a13a77 100644 (file)
@@ -50,7 +50,7 @@ module TcType (
 
   ---------------------------------
   -- Misc type manipulators
-  hoistForAllTys, deNoteType,
+  deNoteType, 
   namesOfType, namesOfDFunHead,
   getDFunTyKey,
 
@@ -721,36 +721,6 @@ is_tc uniq ty = case tcSplitTyConApp_maybe ty of
 %************************************************************************
 
 \begin{code}
-hoistForAllTys :: Type -> Type
--- Used for user-written type signatures only
--- Move all the foralls and constraints to the top
--- e.g.  T -> forall a. a        ==>   forall a. T -> a
---      T -> (?x::Int) -> Int   ==>   (?x::Int) -> T -> Int
---
--- We want to 'look through' type synonyms when doing this
--- so it's better done on the Type than the HsType
-
-hoistForAllTys ty
-  = case hoist ty ty of 
-       (tvs, theta, body) -> mkForAllTys tvs (mkFunTys theta body)
-  where
-    hoist orig_ty (ForAllTy tv ty) = case hoist ty ty of
-                                       (tvs,theta,tau) -> (tv:tvs,theta,tau)
-    hoist orig_ty (FunTy arg res)
-       | isPredTy arg'            = case hoist res res of
-                                       (tvs,theta,tau) -> (tvs,arg':theta,tau)
-       | otherwise                = case hoist res res of
-                                       (tvs,theta,tau) -> (tvs,theta,mkFunTy arg' tau)
-       where
-         arg' = hoistForAllTys arg     -- Don't forget to apply hoist recursively
-                                       -- to the argument type
-
-    hoist orig_ty (NoteTy _ ty)    = hoist orig_ty ty
-    hoist orig_ty ty              = ([], [], orig_ty)
-\end{code}
-
-
-\begin{code}
 deNoteType :: Type -> Type
        -- Remove synonyms, but not source types
 deNoteType ty@(TyVarTy tyvar)  = ty