X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcType.lhs;h=8a13a77058093d7780990bb25b1fe6c14c603597;hb=4bca2e7f766e3a265e77cbce4884f889d6d28299;hp=8e3862c2c10786d33620ff421ed367dfcb40637a;hpb=912f10aaeb2c8ddfdce94ab6a50046c8cb70e76b;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcType.lhs b/ghc/compiler/typecheck/TcType.lhs index 8e3862c..8a13a77 100644 --- a/ghc/compiler/typecheck/TcType.lhs +++ b/ghc/compiler/typecheck/TcType.lhs @@ -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