Commit 50ba9193 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-12-19 13:08:19 by simonpj]

Wibble to printing FunTyCon in GHCi that makes :b GHC.Base work
parent 98a12ec1
......@@ -97,7 +97,7 @@ module GHC (
-- ** Type constructors
TyCon,
tyConTyVars, tyConDataCons, tyConArity,
isClassTyCon, isSynTyCon, isNewTyCon, isPrimTyCon,
isClassTyCon, isSynTyCon, isNewTyCon, isPrimTyCon, isFunTyCon,
getSynTyConDefn,
-- ** Type variables
......@@ -191,7 +191,7 @@ import Id ( Id, idType, isImplicitId, isDeadBinder,
import Var ( TyVar )
import TysPrim ( alphaTyVars )
import TyCon ( TyCon, isClassTyCon, isSynTyCon, isNewTyCon,
isPrimTyCon, tyConArity,
isPrimTyCon, isFunTyCon, tyConArity,
tyConTyVars, tyConDataCons, getSynTyConDefn )
import Class ( Class, classSCTheta, classTvsFds, classMethods )
import FunDeps ( pprFundeps )
......@@ -219,21 +219,19 @@ import FiniteMap
import Panic
import Digraph
import Bag ( unitBag )
import ErrUtils ( Severity(..), showPass, Messages, fatalErrorMsg, debugTraceMsg,
import ErrUtils ( Severity(..), showPass, fatalErrorMsg, debugTraceMsg,
mkPlainErrMsg, printBagOfErrors, printErrorsAndWarnings )
import qualified ErrUtils
import PrelNames ( mAIN )
import Util
import StringBuffer ( StringBuffer, hGetStringBuffer )
import Outputable
import SysTools ( cleanTempFilesExcept )
import BasicTypes
import TcType ( tcSplitSigmaTy, isDictTy )
import FastString ( mkFastString )
import Directory ( getModificationTime, doesFileExist )
import Maybe ( isJust, isNothing, fromJust )
import Maybes ( orElse, expectJust, mapCatMaybes )
import Maybes ( expectJust, mapCatMaybes )
import List ( partition, nub )
import qualified List
import Monad ( unless, when )
......
......@@ -67,7 +67,8 @@ pprTyThingHdr exts (AClass cls) = pprClassHdr exts cls
pprTyConHdr exts tyCon =
ptext keyword <+> ppr_bndr tyCon <+> hsep (map ppr vars)
where
vars | GHC.isPrimTyCon tyCon = take (GHC.tyConArity tyCon) GHC.alphaTyVars
vars | GHC.isPrimTyCon tyCon ||
GHC.isFunTyCon tyCon = take (GHC.tyConArity tyCon) GHC.alphaTyVars
| otherwise = GHC.tyConTyVars tyCon
keyword | GHC.isSynTyCon tyCon = SLIT("type")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment