X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FType.lhs;h=8817222fbabf004ba67f961f7a63e279a6692061;hb=635952097df211953c4bd0456b37eba64c485f60;hp=8177e5ac9d0a6e1e2dd90503ee7eb5be7de0df4c;hpb=0252f1a49233b7618dc8923f257a37579802fce9;p=ghc-hetmet.git diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index 8177e5a..8817222 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -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} @@ -496,14 +497,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} ---------------------------------------------------------------------