X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprelude%2FPrelInfo.lhs;h=34e049fe041bd5ce3b28c8e8209ae0504fa7bbbc;hb=f6cd95ff9a2bddbd78682dcd9287aec7d152cc13;hp=88bf2f35f707b39b827fc0f3141de3de9896f156;hpb=764d826ef78e39ccf7474fa0d9703ca9dbc966a0;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/PrelInfo.lhs b/ghc/compiler/prelude/PrelInfo.lhs index 88bf2f3..34e049f 100644 --- a/ghc/compiler/prelude/PrelInfo.lhs +++ b/ghc/compiler/prelude/PrelInfo.lhs @@ -8,9 +8,8 @@ module PrelInfo ( module PrelNames, module MkId, - wiredInNames, -- Names of wired in things - wiredInThings, - + wiredInThings, -- Names of wired in things + wiredInThingEnv, -- Primop RdrNames eqH_Char_RDR, ltH_Char_RDR, eqH_Word_RDR, ltH_Word_RDR, @@ -33,23 +32,17 @@ module PrelInfo ( import PrelNames -- Prelude module names import PrimOp ( PrimOp(..), allThePrimOps, primOpRdrName ) -import DataCon ( DataCon, dataConId, dataConWrapId ) +import DataCon ( DataCon ) import MkId ( mkPrimOpId, wiredInIds ) import MkId -- All of it, for re-export import TysPrim ( primTyCons ) import TysWiredIn ( wiredInTyCons ) -import HscTypes ( TyThing(..) ) +import HscTypes ( TyThing(..), implicitTyThingIds, TypeEnv, mkTypeEnv ) -- others: -import RdrName ( RdrName ) -import Name ( Name, getName ) -import TyCon ( tyConDataConsIfAvailable, TyCon ) import Class ( Class, classKey ) import Type ( funTyCon ) -import Bag -import BasicTypes ( Boxity(..) ) import Util ( isIn ) -import Outputable ( ppr, pprPanic ) \end{code} %************************************************************************ @@ -65,8 +58,9 @@ We have two ``builtin name funs,'' one to look up @TyCons@ and wiredInThings :: [TyThing] wiredInThings = concat - [ -- Wired in TyCons - map ATyCon ([funTyCon] ++ primTyCons ++ wiredInTyCons) + [ -- Wired in TyCons and their implicit Ids + tycon_things + , map AnId (implicitTyThingIds tycon_things) -- Wired in Ids , map AnId wiredInIds @@ -74,17 +68,11 @@ wiredInThings -- PrimOps , map (AnId . mkPrimOpId) allThePrimOps ] + where + tycon_things = map ATyCon ([funTyCon] ++ primTyCons ++ wiredInTyCons) -wiredInNames :: [Name] -wiredInNames = [n | thing <- wiredInThings, n <- tyThingNames thing] - -tyThingNames :: TyThing -> [Name] -tyThingNames (AClass cl) = pprPanic "tyThingNames" (ppr cl) -- Not used -tyThingNames (AnId id) = [getName id] -tyThingNames (ATyCon tc) - = getName tc : [ getName n | dc <- tyConDataConsIfAvailable tc, - n <- [dataConId dc, dataConWrapId dc] ] - -- Synonyms return empty list of constructors +wiredInThingEnv :: TypeEnv +wiredInThingEnv = mkTypeEnv wiredInThings \end{code} We let a lot of "non-standard" values be visible, so that we can make