Remove dead code
[ghc-hetmet.git] / compiler / types / Type.lhs
index 8177e5a..4cea101 100644 (file)
@@ -30,7 +30,7 @@ module Type (
 
        mkFunTy, mkFunTys, splitFunTy, splitFunTy_maybe, 
        splitFunTys, splitFunTysN,
-       funResultTy, funArgTy, zipFunTys, typeArity,
+       funResultTy, funArgTy, zipFunTys, 
 
        mkTyConApp, mkTyConTy, 
        tyConAppTyCon, tyConAppArgs, 
@@ -141,7 +141,6 @@ import VarSet
 import Name
 import Class
 import TyCon
-import BasicTypes      ( Arity )
 
 -- others
 import StaticFlags
@@ -151,6 +150,8 @@ import FastString
 
 import Data.List
 import Data.Maybe      ( isJust )
+
+infixr 3 `mkFunTy`     -- Associates to the right
 \end{code}
 
 \begin{code}
@@ -467,7 +468,8 @@ splitFunTys ty = split [] ty ty
 splitFunTysN :: Int -> Type -> ([Type], Type)
 -- ^ Split off exactly the given number argument types, and panics if that is not possible
 splitFunTysN 0 ty = ([], ty)
-splitFunTysN n ty = case splitFunTy ty of { (arg, res) ->
+splitFunTysN n ty = ASSERT2( isFunTy ty, int n <+> ppr ty )
+                    case splitFunTy ty of { (arg, res) ->
                    case splitFunTysN (n-1) res of { (args, res) ->
                    (arg:args, res) }}
 
@@ -496,14 +498,6 @@ funArgTy :: Type -> Type
 funArgTy ty | Just ty' <- coreView ty = funArgTy ty'
 funArgTy (FunTy arg _res)  = arg
 funArgTy ty                = pprPanic "funArgTy" (ppr ty)
-
-typeArity :: Type -> Arity
--- How many value arrows are visible in the type?
--- We look through foralls, but not through newtypes, dictionaries etc
-typeArity ty | Just ty' <- coreView ty = typeArity ty'
-typeArity (FunTy _ ty)    = 1 + typeArity ty
-typeArity (ForAllTy _ ty) = typeArity ty
-typeArity _               = 0
 \end{code}
 
 ---------------------------------------------------------------------