From 09e2c3a13ed67e2ab69a8e0a3eaa608e19713521 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 28 Feb 2005 12:03:12 +0000 Subject: [PATCH] [project @ 2005-02-28 12:03:12 by simonmar] The type variables in the types of wired-in entities were built using mkVarOcc, which gives a variable name rather than a type variable name. Normally the compiler doesn't care, but when tidying types for output to the user the tidier would consider a VarName as distinct from a TvName, and not give them different print names. This fix makes puts all the type variables in the TvName namespace. --- ghc/compiler/basicTypes/OccName.lhs | 5 ++++- ghc/compiler/prelude/TysPrim.lhs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/basicTypes/OccName.lhs b/ghc/compiler/basicTypes/OccName.lhs index 29a6bbc..96a2f2f 100644 --- a/ghc/compiler/basicTypes/OccName.lhs +++ b/ghc/compiler/basicTypes/OccName.lhs @@ -27,7 +27,7 @@ module OccName ( foldOccSet, isEmptyOccSet, intersectOccSet, intersectsOccSet, mkOccName, mkOccFS, mkSysOcc, mkSysOccFS, mkFCallOcc, mkKindOccFS, - mkVarOcc, mkVarOccEncoded, + mkVarOcc, mkVarOccEncoded, mkTyVarOcc, mkSuperDictSelOcc, mkDFunOcc, mkForeignExportOcc, mkDictOcc, mkIPOcc, mkWorkerOcc, mkMethodOcc, mkDefaultMethodOcc, mkDerivedTyConOcc, mkClassTyConOcc, mkClassDataConOcc, mkSpecOcc, @@ -241,6 +241,9 @@ mkOccName ns s = mkSysOcc ns (encode s) mkVarOcc :: UserFS -> OccName mkVarOcc fs = mkSysOccFS varName (encodeFS fs) +mkTyVarOcc :: UserFS -> OccName +mkTyVarOcc fs = mkSysOccFS tvName (encodeFS fs) + mkVarOccEncoded :: EncodedFS -> OccName mkVarOccEncoded fs = mkSysOccFS varName fs \end{code} diff --git a/ghc/compiler/prelude/TysPrim.lhs b/ghc/compiler/prelude/TysPrim.lhs index 155fdf8..b28506e 100644 --- a/ghc/compiler/prelude/TysPrim.lhs +++ b/ghc/compiler/prelude/TysPrim.lhs @@ -47,7 +47,7 @@ module TysPrim( import Var ( TyVar, mkTyVar ) import Name ( Name, BuiltInSyntax(..), mkInternalName, mkWiredInName ) -import OccName ( mkVarOcc, mkOccFS, tcName ) +import OccName ( mkOccFS, tcName, mkTyVarOcc ) import TyCon ( TyCon, ArgVrcs, mkPrimTyCon, mkLiftedPrimTyCon, PrimRep(..) ) import Type ( mkTyConApp, mkTyConTy, mkTyVarTys, mkTyVarTy, @@ -147,7 +147,7 @@ alphaTyVars is a list of type variables for use in templates: \begin{code} tyVarList :: Kind -> [TyVar] tyVarList kind = [ mkTyVar (mkInternalName (mkAlphaTyVarUnique u) - (mkVarOcc (mkFastString name)) + (mkTyVarOcc (mkFastString name)) noSrcLoc) kind | u <- [2..], let name | c <= 'z' = [c] -- 1.7.10.4