-import Var ( TyVar, mkSysTyVar )
-import Name ( Name )
+import Var ( TyVar, mkTyVar )
+import Name ( Name, mkLocalName )
+import OccName ( mkVarOcc )
import PrimRep ( PrimRep(..) )
import TyCon ( TyCon, ArgVrcs, mkPrimTyCon, mkLiftedPrimTyCon )
import Type ( mkTyConApp, mkTyConTy, mkTyVarTys, mkTyVarTy,
import PrimRep ( PrimRep(..) )
import TyCon ( TyCon, ArgVrcs, mkPrimTyCon, mkLiftedPrimTyCon )
import Type ( mkTyConApp, mkTyConTy, mkTyVarTys, mkTyVarTy,
- unliftedTypeKind, liftedTypeKind, openTypeKind, mkArrowKinds
+ unliftedTypeKind, liftedTypeKind, openTypeKind,
+ Kind, mkArrowKinds
+alphaTyVars is a list of type variables for use in templates:
+ ["a", "b", ..., "z", "t1", "t2", ... ]
+
+tyVarList :: Kind -> [TyVar]
+tyVarList kind = [ mkTyVar (mkLocalName (mkAlphaTyVarUnique u)
+ (mkVarOcc (mkFastString name))
+ noSrcLoc) kind
+ | u <- [2..],
+ let name | c <= 'z' = [c]
+ | otherwise = 't':show u
+ where c = chr (u-2 + ord 'a')
+ ]
+
-- openAlphaTyVar is prepared to be instantiated
-- to a lifted or unlifted type variable. It's used for the
-- result type for "error", so that we can have (error Int# "Help")
-- openAlphaTyVar is prepared to be instantiated
-- to a lifted or unlifted type variable. It's used for the
-- result type for "error", so that we can have (error Int# "Help")